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: Question about compiling some C++ code.


Note it makes a difference what you name your file.  If you
name your file something.c, then gcc is invoked, and the code
is compiled as if it were a C program, so standard C++ 
libraries are not linked automatically.  If you name something
on the other hand something.cpp, g++ is used, and the code is 
compiled as C++ code, linking libstdc++ and making C++ functions
available...

Wayne Keen 


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