Using the 5.1 sdk I wasn't able to get -arch accepted even when using libclang.dylib.
After some futzing (namely, manually running the clang commands produced by xcodebuild with the -v
flag as suggested), my best setup was:
let g:clang_complete_auto = 1
"not strictly necessary
set omnifunc=ClangComplete
let g:clang_user_options='clang -cc1 -triple i386-apple-macosx10.6.7 -target-cpu yonah -target-linker-version 128.2 -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/3.1 -fblocks -x objective-c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -D __IPHONE_OS_VERSION_MIN_REQUIRED=50100 || exit 0'
adding -cc1
is the only thing I don't see mentioned in other resources on Stackoverflow or elsewhere (apparently this flag allows the bastardized combination of clang driver and raw cc1 flags to go through). Once this was added it suddenly just worked at least for Cocoa and UIKit completion (try typing [NSString C-x C-u
).
However, something's still mildly busted.
Typing :copen
I see this after a completion (successful or otherwise):
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h|654 col 48 error| expected ';' after top level declarator
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h|14 col 39 error| expected function body after function declarator
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h|60 col 32 info| expanded from macro 'CF_AVAILABLE_IOS'
/usr/include/Availability.h|145 col 53 info| expanded from macro '__OSX_AVAILABLE_STARTING'
<scratch space>|25 col 1 info| expanded from macro '__AVAILABILITY_INTERNAL'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h|92 col 10 error| 'CoreFoundation/CFUserNotification.h' file not found
Also, even though I've added various -I
flags to either my .clang_complete
file or directly to the clang_user_option
s string, clang_complete
only works with some but not all of the headers in my project... with no apparent reason why one works but not others. (Suggestions welcome).