views:

1270

answers:

2

Hi,

I have an Xcode project that has a "master" static library target, that includes/links to a bunch of other static libraries from other Xcode projects.

When building the master library target for "Optimized (armv6 armv7)", an error occurs in the last phase, during the CreateUniversalBinary step. For each .o file of the libraries that is included by the master library, the following error is reported (for example, the FBConnectGlobal.o file):

warning for architecture: armv6 same member name (FBConnectGlobal.o) in output file used for input files: /Developer_Beta/Builds/MTToolbox/MTToolbox.build/Debug-iphoneos/MTToolbox.build/Objects-normal/armv6/libMTToolbox.a(FBConnectGlobal.o) and: /Developer_Beta/Builds/MTToolbox/MTToolbox.build/Debug-iphoneos/MTToolbox.build/Objects-normal/armv7/libMTToolbox.a(FBConnectGlobal.o) due to use of basename, truncation and blank padding

In the end, Xcode tells that the build has succeeded. However, when using the final static library in an application project, it won't build because it finds duplicate symbols in one part of build (armv6) and misses symbols in the other part of the build (armv7).

Any ideas how to fix this?

M

+2  A: 

Don't build libraries into other libraries - it's a recipe for confusion, duplicate symbol errors, and hard-to-debug results. Check out this question: http://stackoverflow.com/questions/2300867/how-can-i-avoid-duplicate-symbol-errors-in-xcode-with-shared-static-libraries/2300873#2300873

Stefan
I have to agree here. I don't know what's best in theory, but in practice, I just spent a couple of weeks tweaking, toggling, and cajoling every build setting and config arrangement under the sun. In the end, the only thing that works was remove ALL static libraries (both binary files AND dependent projects to build static libraries) from the static library that depended on my app. Don't link libraries to libraries. Don't be a hero. Just attach everything to your app directly. Save yourself heaps of time in the process.
Prairiedogg
+2  A: 

I dont think that's the answer at all. It will totally work if you don't have two architectures in there. In the example given in the link, it is possible to link libraries a, b, and c into one library, and link with that.

The problem that Carl is having is that there are two different architectures in the library (arm6 and arm7) and the linker is failing to resolve them correctly.

I found the problem. Its a bug in libtool as far as I can tell. See my post for a solution:

http://blog.binaryfinery.com/?p=225

jamie