Generated shared library's symbols

I have a personal usage issue. Probably only the lead developers @arturo @zach @theo can help to solve it.

I use openFrameworks adding it as a shared library ( into my Android project. Thus I can efficiently use fast compiling and code completion features on Eclipse.

In oF080, I generate a shared library by compiling androidAssimpExample. And I take the generated library from project/libs/armeabi folder and I add it into my own setup. When I do “nm | grep ofRunApp” on this library, I can see the ofRunApp symbol. (ofRunApp method is an example, the problem below is valid for all oF methods)

In oF090, I generate a shared library by compiling again androidAssimpExample. I add the generated library into my own setup. But I get error: “Undefined reference to ofRunApp(ofBaseApp*)”. When I do “nm”, I get “no symbols” response. When I do “nm -D” I see a list of some symbols. When I do “nm -D | grep ofRunApp” nothing returns.

I can run succesfully the original androidAssimpExample (of oF090) on Eclipse. If the symbols are not inside the generated library, the original example could not run. So I think the symbols are inside the library. But I can not reach the symbols from outside. I think you changed some compiling flags and the symbol visibility/accessibility is changed.

Could you give me an idea how I can reach the symbols or how to generate the shared library with visible/accesible symbols.


That’s not very correct, if you compile an application it’ll remove any symbols that it’s not using and add also the ones from the app which will clash with other applications linked later against that library.

since 0.9 you can compile the core as a shared library by running:

make -C libs/openFrameworksCompiled/project/ -PLATFORM_OS=Android SHAREDCORE=1

which will generate a shared library in openframeworksCompiled/lib/android

1 Like

I solved my personal issue for now by generating the .so file by compiling oF with Android Studio. Eclipse did also compile very well but the generated .so file was a little different than what I needed.

BTW, I did also try compling oF as a shared library but I got a lot of errors and I couldn’t do it. I will try it again later. Thanks anyway.