Locating a Problem while creating a Shared Library

Hi guys,

im pretty new to CMake and also to Android. Im supposed to port a c/c++ Program to Android. Its pretty complex and so is the CMakeLists.txt. I managed to successfully build an Android Version of the project running CMake against the Android Toolchain. So far so good.
I had to tweak a few things in the source files so that everything works out and the build finishes.

My Problem know is that I want to execute the main executable on an emulated android device. The executable is linked to some shared library files. (.so) When executing I get the error: linking failed fileName.so not found. The file is clearly there, so I assume that while building this shared library file something went wrong in the build process. In order to get the build running I had to tweak a few things exactly at that stage, meaning when this shared library is created. I needed to tweak the source file because some functions of this file are not provided on Android. So I deleted them. The main developer of the Program told me that this is perfectly fine because not all functions are available on every platform. But I think that i made a mistake and now need to figure out where this mistake happened.

There is no error warning or something like that and the shared library build just fine. But as said when trying to execute the main file on the android device the .so file wont be found.

Building for Linux is perfectly fine. And I saw that there are more library files and especially more symbolic links created than when building for Android. That means that either my assumption of the corrupted creation of the shared library is correct and therefore there are some files missing or the build for linux handles this differently. either way I have to figure out why the shared library is not found on Android. And get this thing running.

Anyone who could help?
I kept this post without any code examples because I wanted to use this first post to formulate my problem. I can provide further information of course but I honestly dont know where to start here.

Would really appreciate your help.

Thanks
Thomas

Hi again, so it turns out that the problem regarding executing the program lays somewhere else. LD_LIBRARY_PATH=pathToLib pathToExecutable -v

works and gives the version number and additional info of the program.
Still, Im not able to run the program. Every other command will freeze the program.
So I have to search somewhere else I guess.
regards
thomas

It sounds like the dynamic link loader can’t find your libraries because they are not installed in a system path such as /usr/lib or /usr/local/lib or found under a runtime path specified with -rpath when building the executable.