-6

我在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
4

2 回答 2

2

在不真正知道您的错误是什么的情况下,通常可以通过执行以下步骤来弄清楚如何修复编译/链接器错误:

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

看起来您还没有将源文件分配给任何 Xcode 目标。

要解决:

  • 突出显示项目资源管理器中的每个源文件(左窗格)。
  • 打开右侧窗格并选择最左侧的选项卡。
  • 选择源文件所属的目标。
于 2012-08-09T13:49:53.393 回答