views:

568

answers:

2

I've done a complete clean uninstall of XCode and deleted the prefs and deleted complete /Developer folder and reinstalled XCode again.

I create a new Cocoa application, go over to Target, doing a "Get info" in the target and enable "C / C++ compiler version" to "LLVM compiler 1.0.2" and press Build.

I get:

ld: warning: directory '/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64' following -L not found
ld: warning: directory '/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64' following -L not found
ld: warning: directory '/usr/lib/i686-apple-darwin10/4.2.1' following -L not found
ld: warning: directory '/usr/lib/gcc/i686-apple-darwin10/4.2.1' following -L not found
ld: warning: directory '/usr/lib/gcc/i686-apple-darwin10/4.2.1' following -L not found
ld: warning: directory '/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1' following -L not found
ld: warning: directory '/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../..' following -L not found
ld: library not found for -lgcc
Command /Developer/usr/bin/clang failed with exit code 1

Anyone able to help me here? LLVM + GCC frontend does work though but I really would like to use Clang (LLVM compiler 1.0.2). New XCode install, new Cocoa project still have this issue.

A: 

I had a similar problem when I converted my project to use a custom .xcconfig file (similar to what this person wanted). After setting the custom .xcconfig file for the basis of my build, I saw similar linker errors. I set the "C++ Standard Library Type" build setting to "Static" and now it builds just fine.

Jay Kint
but this is a workaround, rather than a real solution, since linking the C++ library statically is not always desired
Fabio Fracassi
+1  A: 

I fixed it by creating two symbolic links /usr/lib/gcc -> /Developer/usr/lib/gcc and /usr/lib/i686-apple-darwin10 -> /Developer/usr/lib/i686-apple-darwin10/

Thanks for answering guys.

Ger Teunis