Compile error - basic_string.h

Redmer, Autumn (A.) aredmer@ford.com
Fri Aug 11 15:17:00 GMT 2006


Thanks for the help!  It turns out that we have our own minmax.h and it
was stomping on min in basic_string.h.  I only had to move the #include
for our minmax.h below where the basic_string.h is included and the
programs compiled. 

Thanks again!

-----Original Message-----
From: Ian Lance Taylor [mailto:iant@google.com] 
Sent: Thursday, August 10, 2006 12:11 PM
To: Redmer, Autumn (A.)
Cc: gcc-help@gcc.gnu.org
Subject: Re: Compile error - basic_string.h

"Redmer, Autumn \(A.\)" <aredmer@ford.com> writes:

> We are moving an application from HP UX to Linux.  When I try to
compile
> a couple of the programs on Linux (using gcc 3.3.3), I get errors like
> this:
> 
> In file included from /usr/include/g++/string:53,
>                  from /usr/include/g++/bits/locale_classes.h:47,
>                  from /usr/include/g++/bits/ios_base.h:47,
>                  from /usr/include/g++/ios:49,
>                  from /usr/include/g++/ostream:45,
>                  from /usr/include/g++/iostream:45,
>                  from FlexCode.h:26,
>                  from Constraint.h:29,
>                  from AnalysisUtils.h:19,
>                  from AnalysisUtils.cpp:16:
> /usr/include/g++/bits/basic_string.h: In member function `int
>    std::basic_string<_CharT, _Traits, _Alloc>::compare(const
>    std::basic_string<_CharT, _Traits, _Alloc>&) const':
> /usr/include/g++/bits/basic_string.h:824: error: syntax error before
`;'
> token
> 
> Can you give me any suggestions on where I should try to start
debugging
> this?

Look for a preprocessor macro which might be messing up the header
file.

One way to do this is to run the compiler with --save-temps to
generate a .ii file.  Look for the basic_string.h code in the .ii
file.  Compare it to the same code in the .h file.  See if there are
any interesting differences.

Ian




More information about the Gcc-help mailing list