I'm integrating an external library in my iOS project. I get 11 duplicate symbols when I try to compile.
Here's an excerpt of the output:
duplicate symbol _serviceCallReturn in:
/Path/to/my/project/Classes/PointEngine/Device/libPointEngineSDK.a(PointEngineSDKUser.o)
/Path/to/my/project/Classes/PointEngine/Device/libPointEngineSDK.a(PointEngineSDKScanner.o)
duplicate symbol _serviceCallType in:
/Path/to/my/project/Classes/PointEngine/Device/libPointEngineSDK.a(PointEngineSDKScanner.o)
/Path/to/my/project/Classes/PointEngine/Device/libPointEngineSDK.a(PointEngineSDKProof.o)
What does it mean? What is the relation between, say, PointEngineSDKUser.o and libPointEngineSDK.a? Any idea what kind of misconfiguration can lead to this?
When I create an empty iOS Project and integrate the library into it, it works like a charm. The problem must be in my existing project configuration.
                        
In short:
*.ofiles are relocatable ELFs. They are products of the compiler, which always uses source files as input for doing its job.*.afiles are the ar archives. They are product of the so called ar program, which always use relocatable ELF objects as input for doing its job.Now, to resolve the first issue from the two (duplicate symbol _serviceCallReturn):
serviceCallReturnvariable definition in both of them, which is not correct and that's why you see the linker complaining.externkeyword. Otherwise, use a different name for one of the variables.