简体   繁体   中英

ASIHTTPRequest compilation error on iPhone - `set`

I am compiling ASIHTTPRequest in a new iPhone project, and getting a major error on compile.

The error is:

clang: error: no such file or directory: 'set'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed `with exit code 1

Having analysed the compile string, there is only 1 place where 'set' appears, and it is in this line:

set -fno-objc-arc --serialize-diagnostics 

So maybe this is failing?

If so, how do I take this line out to make it build?

The full compile string:

ProcessPCH /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-    bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/PrecompiledHeaders/ArrestsPlotter-Prefix- asfyhfrzleolpzgggflhpvakdbtg/ArrestsPlotter-Prefix.pch.pth ArrestsPlotter/ArrestsPlotter-Prefix.pch normal  i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/willmoss26/Documents/XCode/ArrestsPlotter
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 objective-c-header -arch i386 -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 -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-sign-compare -Wno-shorten-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/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -fexceptions -fasm-blocks -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.6 -g -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -iquote /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/ArrestsPlotter-generated-files.hmap -I/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/ArrestsPlotter-own-target-headers.hmap -I/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/ArrestsPlotter-all-target-headers.hmap -iquote /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/ArrestsPlotter-project-headers.hmap -I/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Products/Debug-iphonesimulator/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/DerivedSources/i386 -I/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/ArrestsPlotter.build/Debug-iphonesimulator/ArrestsPlotter.build/DerivedSources -F/Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Products/Debug-iphonesimulator set -fno-objc-arc --serialize-diagnostics /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/PrecompiledHeaders/ArrestsPlotter-Prefix-asfyhfrzleolpzgggflhpvakdbtg/ArrestsPlotter-Prefix.pch.dia -c /Users/willmoss26/Documents/XCode/ArrestsPlotter/ArrestsPlotter/ArrestsPlotter-Prefix.pch -o /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/PrecompiledHeaders/ArrestsPlotter-Prefix-asfyhfrzleolpzgggflhpvakdbtg/ArrestsPlotter-Prefix.pch.pth -MMD -MT dependencies -MF /Users/willmoss26/Library/Developer/Xcode/DerivedData/ArrestsPlotter-bafbkfhslokdxwcjmtzgipqcqgiv/Build/Intermediates/PrecompiledHeaders/ArrestsPlotter-Prefix-asfyhfrzleolpzgggflhpvakdbtg/ArrestsPlotter-Prefix.pch.d

Thanks very much :)

There's no reason for set to be there. People only generally set -fno-objc-arc on a file-by-file basis, so chances are it's a copy and paste error when you were setting this up.

Select the target you are building, go to the Build Phases section, and under Compile Sources , edit the compiler flags to remove set .

You may want to use a different library: ASIHTTPRequest is no longer being supported by its creator .

NSURLRequest / NSURLConnection are a lot easier to work with in iOS5, so that is one option. I have recently converted a few projects from using ASIHTTPRequest over to using the new NSURL stuff and can attest to the improvements there.

AFNetworking is a new framework gaining in popularity. I'm currently building a project using it and like it a lot; it takes all the work out of consuming JSON/XML.

Ahhh I answered it myself.... nevermind!

The answer is, I had added 'set' to the compile line for a whole load of sources, instead of just adding the appropriate flag. So the compiler was asked, 'what is set'?

Stuuupid :p

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM