IPhone app compiles error with static libraries in distribution

I am currently trying to create a distribution product of my (first) iphone app so that it can be downloaded on the App Store. I went through the whole application profile and distribution distribution and finally got the Organizer and target build config to recognize it.

The problem is when setting Active Setting to Distribute (duplicate of the Vacation configuration for each iPhone Dev Center direction) I cannot get the code to compile. The project contains a link to a static library that contains several classes that are used as base classes in many project classes. Therefore, based on the Distribution configuration, the compiler throws errors saying that it cannot find base classes from the static library, and the build fails.

If I switch Active Config. there is no problem on "Debug" (as used in development) and the application compiles correctly as expected.

I can't seem to find what the problem might be. I found another similar question here, but this seems to be a different case:

Distributing and distributing the iPhone static library build (but not for debugging)

Google also doesn't seem to have many useful results. I also checked the target information in the Build section and switched back and forth between Debug and Distribute configurations to check for any relevant difference, but no one has been found so far. I haven't actually found any information about the static lib. Only on the General tab in the info window, but the static library displays correctly in direct dependencies.

So at the moment I don't know. I tried to follow the instructions as closely as possible, but I think it was not enough and now I am in trouble. I suppose the fix should be somewhat simple (maybe just set some parameter, somewhere), but I haven't been able to figure it out.

Could you (PLEASE :) :) provide some help on this. Any help or hint is greatly appreciated.

Thank you in advance!

+2


source to share


3 answers


Check build options for Debug config; for example, the header search paths for a debug configuration might differ from a distribution configuration. Select the menu Project > Edit Project Settings

and enter: Header Search Paths

to check these settings for the listed ones Configuration

. If anything is different from the configurations, make them the same for both.



+3


source


Here he is:

To create a distribution assembly (for each iPhone Dev Center direction), you must make a copy of the Release configuration and name it Distribution, and then create a project with that active configuration. While checking the "header search paths" in the target info window for Debug and Distribution configurations, I noticed a difference in the value that was set as (for both configurations):

$ {BUILD_STYLE} - $ {PLATFORM_NAME} / usr / local / enable

which resulted in $ {BUILD_STYLE} - $ {PLATFORM_NAME} replaced with "Debug-iphoneos" and "Distribution-iphoneos" for each configuration. All base classes from the static library were saved in the "include" folder, but there was no "Distribution-iphoneos" folder.

This happened because I did not add the Distribute configuration in the static lib project as I did in the main application project (I didn’t know what I should have). So to fix the problem, I only added the same configuration. in a static lib project and built it.



So, if you add a new configuration to a project that uses classes from the referenced static lib, add that same configuration to the static lib project and build. This way the main project will be able to find the base classes.

Maybe this is actually basic stuff, sorry I'm just learning the language (and XCode) :).

Hope this helps, thanks to Alex again.

Hello

+6


source


I've heard of linker issues with the iPhone OS 3.0 SDK; Some of the possible solutions involve adding -all_load to the linker flags when you build your project (although this may have unintended side effects). Another option is to upgrade to the 3.1 SDK, where I believe these issues have been fixed. Of course, this might not be your problem at all ...

Other places for help:

0


source







All Articles