errors when adding a mac static lib to what originally an iphone project
errors when adding a mac static lib to what originally an iphone project
- Subject: errors when adding a mac static lib to what originally an iphone project
- From: Michael Hanna <email@hidden>
- Date: Tue, 12 Jul 2011 16:06:11 -0400
I have an iOS 4.2 project on Xcode 3.2.5 that builds an iOS targeted static library. I add a Mac OS static library target and adjust the Target Build settings to tailor it to build for Mac OS X 10.6. upon compilation I get a series of errors in the AvailabilityInternal.h header.
/Developer/SDKs/MacOSX10.6.sdk/usr/include/AvailabilityInternal.h:56:0 /Developer/SDKs/MacOSX10.6.sdk/usr/include/AvailabilityInternal.h:56:42: error: operator '<' has no left operand
These are the settings that generate the above compilation error:
CompileC build/msl.build/Debug-iphonesimulator/mslMac.build/Objects-normal/i386/msl.o src/msl.cpp normal i386 c++ com.apple.compilers.gcc.4_2
cd /Users/mhanna/hg/main-trunk/firmware/src/framework/msl
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D__MACOSX__ -DDARWIN -isysroot /Developer/SDKs/MacOSX10.6.sdk -fexceptions -mfix-and-continue -mmacosx-version-min=10.6 -gdwarf-2 -D__IPHONE_OS_VERSION_MIN_REQUIRED= -iquote /Users/mhanna/hg/main-trunk/firmware/src/framework/msl/build/msl.build/Debug-iphonesimulator/mslMac.build/mslMac-generated-files.hmap -I/Users/mhanna/hg/main-trunk/firmware/src/framework/msl/build/msl.build/Debug-iphonesimulator/mslMac.build/mslMac-own-target-headers.hmap -I/Users/mhanna/hg/main-trunk/firmware/src/framework/msl/build/msl.build/Debug-iphonesimulator/mslMac.build/mslMac-all-target-headers.hmap -iquote /Users/mhanna/hg/main-trunk/firmware/src/framework/msl/build/msl.build/Debug-iphonesimulator/mslMac.build/mslMac-project-headers.hmap -F/Users/mhanna/hg/main-trunk/firmware/src/framework/msl/build/Debug-iphonesimulator -I/Users/mhanna/hg/main-trunk/firmware/src/framework/msl/build/Debug-iphonesimulator/include -I/Users/mhanna/hg/main-trunk/firmware/src/framework/msl/build/msl.build/Debug-iphonesimulator/mslMac.build/DerivedSources/i386 -I/Users/mhanna/hg/main-trunk/firmware/src/framework/msl/build/msl.build/Debug-iphonesimulator/mslMac.build/DerivedSources -include /var/folders/RU/RUdX21BRF04+HlcO4CdghLM8Ml+/-Caches-/com.apple.Xcode.1980392208/SharedPrecompiledHeaders/msl_Prefix-docomumocsvktgbgorvwaovdtfrp/msl_Prefix.pch -c /Users/mhanna/hg/main-trunk/firmware/src/framework/msl/src/msl.cpp -o /Users/mhanna/hg/main-trunk/firmware/src/framework/msl/build/msl.build/Debug-iphonesimulator/mslMac.build/Objects-normal/i386/msl.o
It appears there are a couple problems:
- Xcode is reaching for the iPhoneSimulator gcc 4.2 compiler, not the Mac OS X gcc 4.2 compiler specified.
- __IPHONE_OS_VERSION_MIN_REQUIRED flag seems to be set, setting off a series of errors in the AvailabilityInternal.h file.
I'm pretty sure these are defined at the *Project* level and they are trickling-down to the *Target* level.
What I don't know is the best way to turn these off. I do not see them appear anywhere in the Project or Target Build settings.
Here are the changes I've made:
- added a Cocoa(Mac OS X) static library target
- added the Cocoa Foundation.framework to the Cocoa target
in the (Cocoa)Target Build settings:
- set the desired architectures
- set the Base SDK
- removed "IPHONE_DEVICE" and replaced it with "__MACOSX__" in the GCC_PREPROCESSOR_DEFINITIONS
- removed the AppKit PCH dependency and set it to the same PCH as the iOS static library target
Any suggestions would be greatly appreciated.
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden