This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: Gcc compiler b18 newbie probs
- To: Cygnus GNU-win32 mailing list <gnu-win32 at cygnus dot com>
- Subject: Re: Gcc compiler b18 newbie probs
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- Date: Thu, 11 Dec 1997 21:20:21 +1100
- References: <19971210220223.5992.qmail@hotmail.com>
Earnie Boyd <earnie_boyd@hotmail.com> wrote:
>
>
> >To: Rich Dorfman <webhead@web-feats.com>
> >Cc: gnu-win32@cygnus.com
> >Subject: Re: Gcc compiler b18 newbie probs
> >Date: Wed, 10 Dec 1997 09:40:38 -0600
> >From: Mumit Khan <khan@xraylith.wisc.edu>
> >
> >Rule-of-thumb, especially for new users:
> >
> > - use the right compiler driver to compile/link programs. For C
> programs,
> > use gcc, for C++ use c++ and for F77 use g77.
>
> ^^^ shouldn't this be g++
Depends on what you want to link in.
`c++' just links in the standard C++ libraries, I think.
`g++' also links in libg++.
> gcc will (or so it is documented to do so) determine if the code is C++.
> Also file extensions are used to determine C vs C++. The cygwin gcc
> will compile a file named hello.c as C if you type
>
> gcc -c hello.c
>
> It will compile it as C++ if you type
>
> gcc -c hello.C
Yes, it will _compile_ it as C++, but if you do `gcc hello.C' it
will still _link_ it as if it were C (that is, it won't link in
the C++ libraries).
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".