编译Mac应用程序时出现Xcode(clang)错误

时间:2013-01-04 04:39:17

标签: xcode macos clang

我正在尝试编译Mac应用程序,但Xcode给了我这个错误:

ProcessPCH /Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/PrecompiledHeaders/myproj-Prefix-epkmwajobvayuietjwkbptfdivuu/myproj-Prefix.pch.pth myproj/myproj-Prefix.pch normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/pedrofranceschi/Desktop/TUDO/myproj
    setenv LANG en_US.US-ASCII
    /usr/bin/gcc-4.2 -x objective-c-header -arch x86_64 -fmessage-length=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wduplicate-method-match -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -fasm-blocks -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.7 -g -Wno-sign-conversion "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -iquote /Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/myproj.build/Debug/myproj.build/myproj-generated-files.hmap -I/Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/myproj.build/Debug/myproj.build/myproj-own-target-headers.hmap -I/Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/myproj.build/Debug/myproj.build/myproj-all-target-headers.hmap -iquote /Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/myproj.build/Debug/myproj.build/myproj-project-headers.hmap -I/Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Products/Debug/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/myproj.build/Debug/myproj.build/DerivedSources/x86_64 -I/Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/myproj.build/Debug/myproj.build/DerivedSources -F/Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Products/Debug --serialize-diagnostics /Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/PrecompiledHeaders/myproj-Prefix-epkmwajobvayuietjwkbptfdivuu/myproj-Prefix.pch.dia -c /Users/pedrofranceschi/Desktop/TUDO/myproj/myproj/myproj-Prefix.pch -o /Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/PrecompiledHeaders/myproj-Prefix-epkmwajobvayuietjwkbptfdivuu/myproj-Prefix.pch.pth -MMD -MT dependencies -MF /Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/PrecompiledHeaders/myproj-Prefix-epkmwajobvayuietjwkbptfdivuu/myproj-Prefix.pch.d

i686-apple-darwin11-gcc-4.2.1: /Users/pedrofranceschi/Library/Developer/Xcode/DerivedData/myproj-ezqihosacfpbfbdsrtmsgtbnvjmk/Build/Intermediates/PrecompiledHeaders/myproj-Prefix-epkmwajobvayuietjwkbptfdivuu/myproj-Prefix.pch.dia: No such file or directory
cc1obj: error: unrecognized command line option "-Wno-implicit-atomic-properties"
cc1obj: error: unrecognized command line option "-Wno-receiver-is-weak"
cc1obj: error: unrecognized command line option "-Wduplicate-method-match"
cc1obj: error: unrecognized command line option "-Wno-deprecated-implementations"
cc1obj: error: unrecognized command line option "-Wno-sign-conversion"
cc1obj: error: unrecognized command line option "-fobjc-arc"
cc1obj: error: unrecognized command line option "-fserialize-diagnostics"
cc1obj: warning: -Wuninitialized is not supported without -O
Command /usr/bin/gcc-4.2 failed with exit code 1

有什么想法吗?

此致

佩德罗

1 个答案:

答案 0 :(得分:0)

  1. 您获得的错误是由于项目设置造成的。这是 很可能是一个较旧的项目,建立在较旧版本的OS X / SDK上 比你目前正在运行的。逐个获取错误并进行搜索 是什么导致了他们每个人。例如,

    cc1obj: error: unrecognized command line option "-Wno-implicit-atomic-properties"
    

    与Implicit Atomic Objective-C Properties LLVM编译器有关 在项目设置中启用警告。尝试删除此设置 并检查是否仍然出现错误,等等。

  2. 同时检查命令行工具是否安装正确,因为 这似乎是一个命令行工具问题。它们是单独下载的。转到XCode / Preferences / Downloads / Components,您应该在列表中有一个名为命令行工具的项目,其状态应为“已安装”。如果没有,请下载并安装它。希望这会有所帮助。