Re: llvm-gcc-4.2 link-time error seen from command line but not in Xcode 3.2
Re: llvm-gcc-4.2 link-time error seen from command line but not in Xcode 3.2
- Subject: Re: llvm-gcc-4.2 link-time error seen from command line but not in Xcode 3.2
- From: Jonas Maebe <email@hidden>
- Date: Sat, 29 Aug 2009 21:47:36 +0200
On 29 Aug 2009, at 21:21, Jay Reynolds Freeman wrote:
/Developer/usr/bin/llvm-gcc-4.2 -D DATE=`date +\"%D\"` -D TIME=`date
+\"%T\"` -m64 -O3 -Wall -I/usr/include -I../include -D
FLOATS_ARE_64_BIT -D USE_TTY_IO -o WraithScheme CommandInterface.c++
gcc is the compiler driver. In succession, it calls the compiler,
assembler and linker. If you do not specify the language of your
source files (using the -x command line parameter), it guesses the
language based on the source file extension. "c++" is not a
standardised extension for c++ code (cc and cpp are), and hence it
probably assumes that it's regular C.
Now, the C compiler (cc1obj) is apparently able to hand off C++ code
to the C++ compiler (cc1plus), otherwise you'd presumably already get
errors during the compilation. However, afterwards the driver calls
the assembler and subsequently the linker, still assuming that you're
compiling regular C code. For the assembler that's irrelevant, for the
linker it is, since for C++ a number of extra libraries are required.
If you compile with g++, then you tell the driver that you're
compiling C++ code and hence the correct libraries will be linked in.
Jonas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden