This is the mail archive of the cygwin mailing list for the Cygwin 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: 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
> that
> 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
> out
> 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
> same
> 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)

Gareth

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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