在Xcode新项目中启用LLVM + Clang会导致链接错误 [英] Enable LLVM + Clang in Xcode new project causes linking errors
问题描述
我创建了一个新的Cocoa应用程序,并将其添加到Xcode中。转到目标,在目标中执行获取信息并启用C / C ++编译器版本到LLVM编译器1.0.2并按Build。
我得到:
ld:warning:directory'/usr/lib/gcc/i686-apple-darwin10/4.2.1/ x86_64'以下-L未找到
ld:warning:目录'/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64'以下-L未找到
ld:warning:目录'/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未找到
ld:warning:目录'/usr/lib/gcc/i686-apple-darwin10/4.2.1'以下-L未找到
ld:warning:目录'/ 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/../../ ..'以下-L未找到
ld:没有为-lgcc找到库
命令/ Developer / usr / bin / clang失败,退出代码1
任何人都能帮助我? LLVM + GCC前端虽然工作,但我真的想使用Clang(LLVM编译器1.0.2)。新的XCode安装,新的Cocoa项目仍然有这个问题。
我通过创建两个符号链接修复它
/ usr / lib / gcc
- > / Developer / usr / lib / gcc
和
/ usr / lib / i686-apple-darwin10
- > / Developer / usr / lib / i686-apple-darwin10 /
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.
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.
这篇关于在Xcode新项目中启用LLVM + Clang会导致链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!