1

我刚刚将 Xcode 升级到 4.6,现在我的项目不再构建。

这里的错误信息:

clang: error: unknown warning option '-Wno-pragmas'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

错误信息

谢谢。

更新

我不知道它是否是一个重要的标志,但如果我从 GTLTouchStaticLib 的 Build Settings 中删除这个标志,我可以在没有错误消息的情况下编译:

-Wno-unknown-pragmas

其他警告标志中。

在另一个构建之前需要清理。

4

1 回答 1

4

The error is actually pretty clear, isn't it? Xcode calls clang with the option -Wno-pragma and clang complains that it does not know any such option. Since Xcode is not setting this option by default, you must have manually added this option in the build settings. If you don't really need, just disable/remove it.

What is a bit strange is that clang actually does know this option, at least on my system (just like clang also knows -Wno-unknown-pragmas). So you may want to go to the build log and look up the exact clang command line call that Xcode performs. In the build log, you can select the failed build and expand the failed call, which will you give the exact command line call that Xcode performed in attempt to build a source file.

于 2013-01-29T10:35:05.233 回答