I have been trying to compile C++ code for an Android application for a week now. I was able to get the project built and linked if I supply a static library file for one of the third party libraries. However, when I supply a shared object version of the same library, every function that I call in my code that exists in the so file suddenly errors with as an undefined reference. I run a 'nm | grep' command on the so file, and confirmed that the functions exist and are defined (with a lowercase 'd').
I have found that to get ndk-build to find the libraries (static or shared) I have to put the full path and filename in the LOCAL_LDLIBS parameter. If I do things the way I read you are supposed to (LOCAL_STATIC_LIBRARIES or LOCAL_SHARED_LIBRARIES), ndk-build does not appear to find the files and I get undefined references errors.
The weird thing, though, is that another library that I am also using does not produce these errors. For reference, the third party libraries that I am using are: libcurl and WebRTC. The libcurl library .so file was built using the library's configure and make files. The WebRTC library so file is built by first using ninja to build the object and static library files, and then I have another script that compiles the .so file using either the static libraries or the all of the individual object files I need.
Is there some special flags that need to be set, or a certain way that the the so file needs to be configured / built in order to be "compatible" with ndk-build or Android architectures?
For reference, I am building for the armeabi-v7a and arch-arm64 architectures.
I just had a thought to try and build my library with the WebRTC object files to see if those are good and it's just the so file that is bad. I will update the thread on the results.