2012-07-27 114 views
0

我想编译一个项目使用ASIHTTPREQUEST库。ASIHTTPREQUEST框架编译错误时调用方法/链接错误

我遵循指示并链接到所有必要的库,并且我没有得到没有编译错误的错误......我被允许尝试编译该项目。

的问题,只有当我尝试从本教程在我的.m

NSURL *colorURL = [NSURL URLWithString:@"http://www.colourlovers.com/api/colors?format=json"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:colorURL]; [request setDelegate:self]; [request startAsynchronous];

使用此代码出现: http://ios-blog.co.uk/tutorials/parsing-json-on-ios-with-asihttprequest-and-sbjson/

Ld /Users/johndoe/Library/Developer/Xcode/DerivedData/round5-bdubuaqrmfeeujdoabfnpkzsctpa/Build/Products/Debug-iphonesimulator/round5.app/round5 normal i386 cd /Users/johndoe/Documents/apps/iphone/corelocationtest/round5 setenv MACOSX_DEPLOYMENT_TARGET 10.6 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 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/johndoe/Library/Developer/Xcode/DerivedData/round5-bdubuaqrmfeeujdoabfnpkzsctpa/Build/Products/Debug-iphonesimulator -F/Users/johndoe/Library/Developer/Xcode/DerivedData/round5-bdubuaqrmfeeujdoabfnpkzsctpa/Build/Products/Debug-iphonesimulator -filelist /Users/johndoe/Library/Developer/Xcode/DerivedData/round5-bdubuaqrmfeeujdoabfnpkzsctpa/Build/Intermediates/round5.build/Debug-iphonesimulator/round5.build/Objects-normal/i386/round5.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -lz -framework CFNetwork -framework SystemConfiguration -framework MobileCoreServices -framework CoreLocation -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/johndoe/Library/Developer/Xcode/DerivedData/round5-bdubuaqrmfeeujdoabfnpkzsctpa/Build/Products/Debug-iphonesimulator/round5.app/round5 Undefined symbols for architecture i386: "_OBJC_CLASS_$_ASIHTTPRequest", referenced from: objc-class-ref in round5ViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

我不明白这是什么错误意味着:

Undefined symbols for architecture i386: "_OBJC_CLASS_$_ASIHTTPRequest", referenced from: objc-class-ref in round5ViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

真的失去了...请帮助!!

PS:我看了一些其他线程堆栈溢出,但他们没有引用相同的错误。

回答

1

没关系!

重复: Error with iOS 5.1 when i use ASIHTTPRequest and SBJSON

你的时候“我想看看你的目标的构建阶段部分下。‘编译源’,确保你看到ASIHTTPRequest和SBJson的.m文件有时。将外部类拖放到项目中,即使您选中了将文件复制到项目中的框,也不会将它们放入这些编译源中。将文件拖入Xcode时,会出现一个复选框以将文件添加到目标,如果没有选中,文件将不会进入编译源文件,删除文件并重新添加它们,确保这个文件被选中(或者你可以手动添加.m文件喜欢)。”

by jmstone