4

I have an XCode 4 project that used the Legacy build location (File->Project Settings->Advanced).

The project has three targets. A static library A consumed a static library B and then linked into a consuming app C.

I utilized the gist from this question (Build fat static library (device + simulator) using Xcode and SDK 4+) to build a universal static library of A and B and then they're lipo'd into one .a that is linked in C. All works wonderfully.

Recently, I migrated (experimented) with setting the Build Location to the XCode default in DerivedData, my application C has started to have linker errors related to the objects defined in A. It's quite confusing since I've validated that the fat library is being created correctly.

Is there some other caveat to moving to the XCode default that I should be aware of?

Update

Updating with images. With Legacy selected, everything builds fine. With Xcode Default, I get linker errors. This setting isn't even store in your project so I have to make sure all machine building this project use that setting. I don't understand the correlation between this setting and the linker errors. Has anyone else encountered this?

enter image description here

Update 2

I've discovered this has to do with the way I bundle in library A into B. I use libtool in the following manner.

 libtool -static -o superlib.a out/*.a

This command succeeds but the resulting .a doesn't link properly with the application. If I take all the out/*.a files and link them independently with the app, it works fine. Also w/ the Legacy build location, the superlib.a works fine.

Perplexing.

Community
  • 1
  • 1
Ternary
  • 2,401
  • 3
  • 31
  • 54

0 Answers0