This is the mail archive of the
mailing list for the Cygwin project.
RE: G++ for CygWin
- From: "Gareth Pearce" <tilps at hotmail dot com>
- To: <cygwin at cygwin dot com>
- Date: Wed, 28 Jan 2004 22:57:23 +1100
- Subject: RE: G++ for CygWin
> > (gnu separated out its frontend from its backend with v3.3)
> AFAIR, the only significant difference between gcc.exe and g++.exe is
> gcc.exe assumes files are C by default, and hence calls out to the cc1.exe
> compiler, whereas g++ assumes programs are C++ by default, and so calls
> to cc1plus.exe. Oh, and g++ also adds a few directories to the default
> includes search path, and adds -lstdc++ to the linker line.
> This is more-or-less the same thing that happens when you use the -x
> language option: "gcc.exe -xc++ <files, options>" amounts to almost the
> thing as "g++.exe <files, options>", and similarly "g++.exe -xc <files,
> options>" is almost the same as "gcc.exe <files, options>".
I'd like to point out here that if your compiling c++ files, use g++. A
common problem is people who are used to being able to use gcc and just add
-lstdc++ to the link, which worked successfully back with gcc2. It doesn't
always work with gcc3 - hence just use g++, it is simpler and you don't have
to worry about the details, now - or in the future.
Its also worth noting that gcc doesn't assume files are c by default, gcc
makes a guess based on the file extension. But again, the guess mode isn't
always the same as using the -x option. (although it probably should be the
same, some of the internals don't actually understand the -x options and use
file extension guess work exclusively)
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html