tags:

views:

670

answers:

1

I'm building application for iPhone OS 3.0 Due to bug in GCC 4.2.1 I'm adding -all_load flag to linker, to build it on iPhone OS 3.0 But then I get duplicate symbol _fill_fopen_filefunc in /Users/TMC2/Programming/Client/test/build/Debug-iphoneos/test.a(ioapi.o) and /Users/TMC2/Programming/Client/test/build/Debug-iphoneos/test.a(ioapi.o)

How to avoid duplicate symbols? Andy suggestions?

+1  A: 

Rerun the linker command omitting one of the libraries and see what happens. This is fairly straight forward if you pipe the build output to a file and just edit the linker statement.

Since you are building with source it is worth a try to replace one of the source files that generate ioapi.o with something containing only whitespace. Static libraries do not need to resolve their symbols until something links a loadable module from them.

Your mileage may vary on either of these.

ojblass
If you notice, the same library and object inside of that library is referred to twice. I'm running into this same issue and it only crops up when -all_load is specified.
fried