I'am finalising an Open Source C coded CometD library, I thought it would be a good idea to open it to OSX/iOS users, like myself.
In order to ease up the work for OSX/iOS developers I wanted to switch from a static C library to a Xcode iOS Static Libary. So I have followed advices found on the net, and generated a static iOS compatible library.
The problem is that, each time when I am trying to use it, I get an error of type :
Undefined symbols for architecture x86_64: ******, referenced from: -********** in *******.a(*******.o)
This error get repeated for almost every C function that I have in my library.
First I thought maybe the library is not x86_64 compatible
, empty, or really doesn't have any x86_64 symbol in it.
So I have checked with a "lipo -info" on the library and here is the answer :
To really be sure i also used "nm -arch x86_64" on the library, and went fetching for several undefined functions reported by Xcode as errors. I thought i will be wrong and find nothing but guess what ?
So my question is :
If the symbols are present in a x86_64 compatible library, why Xcode prompting this error ? Even if I compiling the library for all arm*/s types I am still getting this x86_64 error.
Am I unaware of something or am I just doing it wrong ?
Your answers are always appreciated.
Update (This is the link to the Xcode Project) : https://github.com/GhostGumm/CometD-x86_64-issue
Update 2 : Mr Trojanfoe attracted my attention on a linking Warning I had when compiling. Indeed the linker seemed to miss load the library looking for a directory that doesn't existed. After moving the library to the right directory, linking it manually, the x86_64 error disappeared.
Sadly the problem is still present. Just after a successful compilation, i tried to use the lib , but, when I "alloc" and "init" my main class like so :
ZetaFactory *Client = [[ZetaFactory alloc] init];
The x86_64 error comes back roaring with the genuine fierce of a billion suns. I posted the link to the Xcode project, please feel free to test it as i don't have any more ideas on how to fix it, but more importantly why and where this gets buggy.
None the less I will continue to investigate.