2012-07-27 117 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