Igor
Igor

Reputation: 51

GCC 4.2.1 darwin Avoid duplicate symbols

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?

Upvotes: 2

Views: 1497

Answers (1)

ojblass
ojblass

Reputation: 21620

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.

Upvotes: 1

Related Questions