我该如何解决错误?

时间:2012-08-09 13:44:05

标签: objective-c compiler-errors

我正在使用objective-c进行编程,我遇到了这个错误,我该如何解决呢?

CompileC DerivedData/MyBook/Build/Intermediates/MyBook.build/Debug-iphonesimulator/MyBook.build/Objects-normal/i386/ioapi-B8F5CE0D70C54AA1.o ioapi.c normal i386 c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/kilovata/Documents/Projects/MyBook
    setenv LANG en_US.US-ASCII
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch i386 -fmessage-length=0 -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -fexceptions -fasm-blocks -Wdeprecated-declarations -mmacosx-version-min=10.6 -g -Wno-conversion -Wno-sign-conversion -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -iquote /Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Intermediates/MyBook.build/Debug-iphonesimulator/MyBook.build/MyBook-generated-files.hmap -I/Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Intermediates/MyBook.build/Debug-iphonesimulator/MyBook.build/MyBook-own-target-headers.hmap -I/Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Intermediates/MyBook.build/Debug-iphonesimulator/MyBook.build/MyBook-all-target-headers.hmap -iquote /Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Intermediates/MyBook.build/Debug-iphonesimulator/MyBook.build/MyBook-project-headers.hmap -I/Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Products/Debug-iphonesimulator/include -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/usr/include/libxml2 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/usr/include/libxml2/libxml -I/Users/kilovata/Documents/Projects/MyBook/SDWebImage -I/Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Intermediates/MyBook.build/Debug-iphonesimulator/MyBook.build/DerivedSources/i386 -I/Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Intermediates/MyBook.build/Debug-iphonesimulator/MyBook.build/DerivedSources -F/Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Products/Debug-iphonesimulator -DNS_BLOCK_ASSERTIONS=1 -include /Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Intermediates/PrecompiledHeaders/MyBook-Prefix-ejgtcvngmdefurdjssqldbeazpbs/MyBook-Prefix.pch -MMD -MT dependencies -MF /Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Intermediates/MyBook.build/Debug-iphonesimulator/MyBook.build/Objects-normal/i386/ioapi-B8F5CE0D70C54AA1.d --serialize-diagnostics /Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Intermediates/MyBook.build/Debug-iphonesimulator/MyBook.build/Objects-normal/i386/ioapi-B8F5CE0D70C54AA1.dia -c /Users/kilovata/Documents/Projects/MyBook/ioapi.c -o /Users/kilovata/Documents/Projects/MyBook/DerivedData/MyBook/Build/Intermediates/MyBook.build/Debug-iphonesimulator/MyBook.build/Objects-normal/i386/ioapi-B8F5CE0D70C54AA1.o

clang: error: no such file or directory: '/Users/kilovata/Documents/Projects/MyBook/ioapi.c'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

2 个答案:

答案 0 :(得分:2)

如果不确切地知道错误是什么,通常可以通过执行以下步骤找出修复编译/链接器错误的方法:

  1. 在错误视图中单击(或双击)错误(取决于IDE),这会将您带到错误适用的代码中的适用区域。
  2. 如果步骤1没有带您到任何地方(可能是链接器错误)或者您不确定该行为何产生错误,请尝试使用Google搜索确切的错误消息,并查看结果以查看它们是否有帮助。
  3. 如果所有其他方法都失败了,您可以来SO并发布描述错误所需的MINIMUM。发布您的整个构建日志并不是社区真正接受的

答案 1 :(得分:1)

看起来您尚未将源文件分配给任何Xcode目标。

要解决:

  • 突出显示项目资源管理器中的每个源文件(左窗格)。
  • 打开右窗格并选择最左侧的标签。
  • 选择源文件所属的目标。