开发者

invalid value '' in '-std=' when switch from GCC 4.2 to LLVM 2.0

I'd like to change from using GCC version 4.2 to LLVM version 2.0 in XCode4. When I change the compiler flag to to LLVM I get an error: invalid value '' in '-std='. Was having it in the *_prefix.pch file, but after turning off the GCC_Precompile_prefix_header the error moved to a n开发者_如何学JAVAew point in my code. The initial value use seems to refer to an empty string. What's going on here.

The full error message is below. Many thanks

CompileC /Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/Objects-normal/i386/GameViewController.o Classes/GameViewController.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/cram/Projects/MightyMemory
    setenv LANG en_US.US-ASCII
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -std= -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -fexceptions -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -fvisibility=hidden -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -iquote /Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/MightyMemory-generated-files.hmap -I/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/MightyMemory-own-target-headers.hmap -I/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/MightyMemory-all-target-headers.hmap -iquote /Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/MightyMemory-project-headers.hmap -I/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Products/Debug-iphonesimulator/include -I/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/DerivedSources/i386 -I/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/DerivedSources -F/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Products/Debug-iphonesimulator -include /Users/cram/Projects/MightyMemory/MaxMemory_Prefix.pch -c /Users/cram/Projects/MightyMemory/Classes/GameViewController.m -o /Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/Objects-normal/i386/GameViewController.o

error: invalid value '' in '-std='


I solved the problem. For the next person to run up against this: It turns out that the options that were passed to the compiler were incorrect; not that I changed them from what they were when using gcc. The error was that the GCC_C_LANGUAGE_STANDARD was not set, i.e. the argument that XCode4 put is was '' (a blank string). I set it to compiler default and all was good.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜