• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: llvm-gcc-4.2 link-time error seen from command line but not in Xcode 3.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: SOLVED -- llvm-gcc-4.2 link-time error seen from command line but not in Xcode 3.2
      • From: Jay Reynolds Freeman <email@hidden>
References: 
 >llvm-gcc-4.2 link-time error seen from command line but not in Xcode 3.2 (From: Jay Reynolds Freeman <email@hidden>)
 >Re: llvm-gcc-4.2 link-time error seen from command line but not in Xcode 3.2 (From: Chris Espinosa <email@hidden>)
 >Re: llvm-gcc-4.2 link-time error seen from command line but not in Xcode 3.2 (From: Jay Reynolds Freeman <email@hidden>)

  • Prev by Date: Re: Verbose Output in Build Results Window - Xcode 3.2
  • Next by Date: A couple bugs in xcode 3.2, not certain if I just have a bad install
  • Previous by thread: Re: llvm-gcc-4.2 link-time error seen from command line but not in Xcode 3.2
  • Next by thread: Re: SOLVED -- llvm-gcc-4.2 link-time error seen from command line but not in Xcode 3.2
  • Index(es):
    • Date
    • Thread