[FAQ] Xcode 2.2 Project Doesn't Compile C++ as C++ [was: How does Xcode decide whether to use g++ for linking or gcc]
[FAQ] Xcode 2.2 Project Doesn't Compile C++ as C++ [was: How does Xcode decide whether to use g++ for linking or gcc]
- Subject: [FAQ] Xcode 2.2 Project Doesn't Compile C++ as C++ [was: How does Xcode decide whether to use g++ for linking or gcc]
- From: Chris Espinosa <email@hidden>
- Date: Fri, 13 Jan 2006 13:18:12 -0800
On Jan 13, 2006, at 11:16 AM, Holger Hoerich wrote:
seems like I'm looking at the wrong places ... I can't find anything
about this:
I just upgraded my projects to Xcode 2.2. After a lengthy cleanup
session of my build settings now everything worked. But as I started
with a new project from scratch using a library which was build with
an existing project I got all this linking errors about unresolved
symbols like I had missed to include libstdc++.a.
So I figured out the difference was that my old project used g++ for
linking while my new one uses gcc. Is there any way to conveniently
tell the linker to use g++ instead of gcc except overriding all the
different LD_$(arch) settings?
gcc is the top-level compiler driver. It determines (by a combination
of file extensions and the -x flag) what actual compiler to invoke.
Xcode drives this by the "file type" of each file, stored in the
project file.
The most common thing we've seen is that in your older project, the
file types of your C++ files were set to
sourcecode.cpp
instead of the (don't ask why it's) more correct
sourcecode.cpp.cpp
Select all your .cp or .cpp files, do Get Info, and in the General tab
set the File Type to sourcecode.cpp.cpp, and Xcode 2.2 should force C++
execution
Chris
_______________________________________________
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