Re: help: how to compile c++
- From: Tom Harrington <tph@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 29 May 2006 21:51:43 -0600
In article <carl-09BD7F.20043629052006@xxxxxxxxxxxxxxxxxxxxxxxx>,
Carl Witthoft <carl@xxxxxxxxxxxx> wrote:
HI -- I'm well experienced in programming under unix, but haven't ever
played w/ c++. I have successfully compiled c programs on OSX (using
gcc of course). The problem is my child needs to write stuff in c++
for a professor. Her first try crashed, which is to say gcc didn't
like it.
So: can anyone tell me what I need to set up? Should gcc be able to
handle c++, or do I need to set some switches, or download different
libraries, etc?
Well, I normally don't say it, but since you're someone experienced in
programming on Unix, I think "RTFM" might be in order. "man gcc" is a
great place to start. This kind of thing is the same on Mac OS X as on
any other Unix box.
GCC normally uses the filename extension to decide what language is
likely to be in the file. File "foo.c" will normally be assumed to be C
rather than C++, but "foo.cpp" would be assumed to be C++.
There's also "g++", which is just gcc but with the default language set
to C++ rather than C. Replace "gcc" with "g++" and you may be set.
Finally of course there's gcc's "-x" option, which allows you to specify
any supported language you like regardless of anything else. Name your
C++ file "foo.java" if you like, and the right "-x" flag will make it
work.
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
.
- Follow-Ups:
- Re: help: how to compile c++
- From: Dave Seaman
- Re: help: how to compile c++
- References:
- help: how to compile c++
- From: Carl Witthoft
- help: how to compile c++
- Prev by Date: Re: Gmail
- Next by Date: ADVICE NEEDED: installing OS X on a formerly OS 9 machine
- Previous by thread: Re: help: how to compile c++
- Next by thread: Re: help: how to compile c++
- Index(es):
Relevant Pages
|