Problems linking static libraries in Xcode 4

Everything was right in the world until I upgraded to Xcode 4 a few days ago. Since then, I have had endless problems so that everything works as it should. And I have an important update that I need to release. I tried every permutation of settings that I can think of, restart, reinstall Xcode, go back to the old versions of my files, about everything.

My project is linked to three static libraries contained in three other projects. I used standard processes for linking libraries (drag and drop project files into mine, add their products as target dependencies, add lib ---. A files to the Link Binary With Libraries phase). And in fact, I have no problem compiling with the Debug configuration configuration, either for the simulator or for my test device.

Where everything goes sideways when I compile the Release Build configuration, or when I try to Archive. I got a lot of different errors depending on my settings, but most of them are variations:

ld: warning: ignoring the file [...] / Build / Products / Debug-iphonesimulator / libGDataTouchStaticLib.a, the file was created for an archive that is not related to architecture (armv6) Undefined characters for architecture armv6:
"_OBJC_CLASS _ $ _ GDataSpreadsheetData", link: objc-class-ref in ExportViewController.o

I can’t understand why he even looks at the products in the Debug-iphonesimulator directory (I swear everything that I connect finds itself in the Finder to be in the proper Release-iphoneos directory).

I set a ridiculous amount of hours to fix this, really need help! Thanks!

+4
source share
3 answers

Please check this question and answer. I ran into the same problem and fixed it.

Xcode4 binding problem. File was created for an archive that is not related to architecture (arm6)

+1
source

I solved this problem by copying the .a lib files from the Release-iphoneos directory to the Debug-iphonesimulator directory to find the correct files, even if Xcode was looking for the wrong directory.

However, I ran into a problem raised by a package with several applications here - and this solution did not work for me. Finally, I gave up and reinstalled Xcode 3. Compiled, archived, and downloaded to the App Store in 20 minutes. There will be some time and several dot releases before I send Xcode 4 another snapshot.

0
source

You may have -DGDATA_REQUIRE_SERVICE_INCLUDES = 1 enabled in other C flags for the GDataTouchStaticLib target. If so, add the required service, in this case, spreadsheets by adding -DGDATA_INCLUDE_SPREADSHEET_SERVICE = 1 to your other C flags. Or, if you do not want GData to require the inclusion of services (which will build everything in a static lib, not just what you need), just remove the DGDATA_REQUIRE_SERVICE_INCLUDES flag.

0
source

Source: https://habr.com/ru/post/1343675/


All Articles