【问题标题】:Enable LLVM + Clang in Xcode new project causes linking errors在 Xcode 新项目中启用 LLVM + Clang 会导致链接错误
【发布时间】:2010-06-08 17:19:03
【问题描述】:

我已经彻底卸载 XCode 并删除了 prefs 并删除了完整的 /Developer 文件夹并再次重新安装了 XCode。

我创建了一个新的 Cocoa 应用程序,转到 Target,在目标中执行“获取信息”并将“C/C++ 编译器版本”启用为“LLVM 编译器 1.0.2”,然后按 Build。

我明白了:

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

有人能帮我吗? LLVM + GCC 前端确实可以工作,但我真的很想使用 Clang(LLVM 编译器 1.0.2)。新的 XCode 安装,新的 Cocoa 项目仍然有这个问题。

【问题讨论】:

    标签: xcode cocoa linker llvm-clang


    【解决方案1】:

    我通过创建两个符号链接来修复它

    /usr/lib/gcc -> /Developer/usr/lib/gcc

    /usr/lib/i686-apple-darwin10 -> /Developer/usr/lib/i686-apple-darwin10/

    感谢大家的回答。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-22
      • 1970-01-01
      • 2019-05-06
      • 1970-01-01
      • 2018-06-09
      • 1970-01-01
      • 2020-06-15
      • 1970-01-01
      相关资源
      最近更新 更多