I have a C++ codebase which is used by our Android project via JNI (build scripts and such are all Android-specific). I need to update our Objective C project with it which is using an older version of the same library. Problem is that I have only the Objective C code but not the old C++ code and iOS makefiles (they were done by an external agency) – only a binary .a file. How can I generate such a static iOS lib from the JNI code, where to start? I’m reading this right now: http://www.clintharris.net/2009/iphone-app-shared-libraries/ and will update this post with more details if you are interested in helping.
Share
Are you having specific problems in trying this? Assuming the code is cross platform and can run on iOS you simply need to either create a new makefile (Android’s are specialized) or drag the files in a new or existing XCode project.
Apple’s Clang can compile (and you can certainly mix) C, C++ and Obj-C. If you need to for example mix Obj-C and C++ name your file .mm and go.
Example Makefile (note: sloppy but should illustrate!):
http://pastebin.com/ZyrsfT87