Re: [FAQ] Xcode 2.2 Project Doesn't Compile C++ as C++ [was: How does Xcode decide whether to use g++ for linking or gcc]
Re: [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: Re: [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: Holger Hoerich <email@hidden>
- Date: Mon, 16 Jan 2006 10:17:55 +0100
Hi Chris,
thank you for the quick answer.
The problem I described actually occurs in a totally new project (C++
Tool). I link a C frontend with a static library which uses C++. How
do I invoke g++ as linker then? Do I have to override LD?
Btw: When overriding LD I had to strip off a part of the library
search path too. There were a few entries to '/usr/include/gcc/darwin/
*'. Removing them made the project compile.
Thanks much!
Holger
On Jan 13, 2006, at 22:18 Uhr, Chris Espinosa wrote:
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:
40codingtechnologies.com
This email sent to email@hidden
_______________________________________________
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