IPhone static library distribution and build errors (but not for debugging)

Update

Daniel was close, this was not a search path. Header Prefix in GCC 4.2 has been set to: $ (SYSTEM_LIBRARY_DIR) /Frameworks/AppKit.framework/Headers/AppKit.h

I missed this when I combed the first 2 times. I removed it and now everything is fine.


Original question

I have been using / creating products with static libraries for about a week now with no problem.

First time I tried to create a distribution assembly (for ad hoc testing) and I get errors all over the place.

Errors, weirdly say it can't find Appkit headers. Which is weird because this is an iPhone app and shouldn't bind to Appkit headers.

Also, the library name "libFJSCodeDebug.a" turns red when I switch from debug to distribution / release. I suppose this must be a big clue.

To test, I duplicated the debug configuration and renamed it release. It's built perfectly. So it seems that the problem is somewhere in the configuration. Below is a snippet of what I get in Xcode when I build it. (Note: I named my target FJSCodeDebug although it will be used for both debug and release purposes)

Building target "FJSCodeDebug" of project "FJSCode" with configuration "Release" — (169 errors)
    Checking Dependencies
        cd /[redacted]/FJSCode
    setenv PATH "/DeveloperBeta/Platforms/iPhoneOS.platform/Developer/usr/bin:/DeveloperBeta/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /DeveloperBeta/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -x objective-c-header -arch armv6 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -Wreturn-type -Wunused-variable -isysroot /DeveloperBeta/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk -gdwarf-2 -mthumb -miphoneos-version-min=3.0 -iquote /[redacted]/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/FJSCodeDebug-generated-files.hmap -I/[redacted]/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/FJSCodeDebug-own-target-headers.hmap -I/[redacted]/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/FJSCodeDebug-all-target-headers.hmap -iquote /U[redacted]/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/FJSCodeDebug-project-headers.hmap -F/[redacted]/build/Release-iphoneos -I/[redacted]/build/Release-iphoneos/include -I/Users/coreyfloyd/Xcode/ProductionProjects/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/DerivedSources/armv6 -I/[redacted]/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/DerivedSources -c /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h -o /var/folders/R+/R+ofDLtuH1GOYQ1ZQ2C5mk+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/AppKit-gihvhjsfuggoevbehiszhgrzcska/AppKit.h.gch
/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:11:33: error: AppKit/AppKitDefines.h: No such file or directory
/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:12:32: error: AppKit/AppKitErrors.h: No such file or directory
/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:13:37: error: AppKit/NSGraphicsContext.h: No such file or directory
/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:14:35: error: AppKit/NSAccessibility.h: No such file or directory
/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:15:32: error: AppKit/NSActionCell.h: No such file or directory

...... (continues for everything in AppKit)......


Build failed (169 errors)

      

I'm looking for 1 of 2 solutions: Obviously fix the release build to avoid getting these errors OR Change the debug config to have all the important settings needed for the release config.

Any ideas?

+1


source to share


2 answers


it

-c /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h

      



leads me to believe that your build target is trying to compile AppKit.h for some reason (although I don't think it should be done at all) and / or it is looking in the wrong place (that is, root / System, not in SDK / Developer / Platforms / ...).

You have to double check your library / search framework settings paths and AppKit.h is not at compile time.

+1


source


Does your project include Mac OS products? Are you sure you didn't accidentally include a Mac library / frame in your framework group?

In SDK2.2.1 I don't know why, but what always appeals to me is that "Active SDK" and "Active Executable" become out of sync (in the build configuration dropdown). This leads to weird linker errors when the iPhone tries to dynamically link its libraries. This setting seems to fail sometimes when I switch from debug / release or device / simulator.



Perhaps this is a similar case, it's hard to tell without seeing the actual project settings.

0


source







All Articles