This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: streambuf.h:403: parse error before `ios'


Boyan Biandov <bbiandov@SEIU790.org> writes:

> Excellent, this will explain the behavior. What is the default assumption
> meaning what file extension would each compiler assume and also how would
> one force the compiler to ignore the extension as a language descriptor and
> interpret it as specified by the user (may be a command line parameter here)
[snip]

g++ always ignores file name extensions, and assumes C++ .
gcc assumes .c is C, .cc, .cpp, .cxx, and .C are C++ . But gcc doesn't
    link in the standard C++ library, or C++ runtime, so it doesn't
    work for C++

The -x flag (see http://xrl.us/byzf) can be used to specify the
    langauge, overriding the above behaviors for *compilation*, but it
    doesn't change the linking behaviors.

Just use 'gcc' for C, and 'g++' for C++ .



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]