This is treating the library names as CMake variables (which are not defined) resulting in not linking to libsome_library_a.a and libsome_library_b.a.
I’m inclined to think that Projucer should export the External Libraries to Link without the ${} surrounding the library names. Or am I missing something?
Specifying the libraries to link as part of Extra Linker Flags (like -lsome_library_a) add those names to CMAKE_SHARED_LINKER_FLAGS which in my case doesn’t seem to work for some reason.
Any tips on how to properly link prebuilt libraries?
This change has appeared to break linking when the user library has an ${ANDROID_ABI} in the name, the variable apparently doesn’t make it through to the link step (which is obviously needed in most cases when doing multi-arch builds).
The previous way has worked just fine for me for a long time, so I’m not sure what the cause of the original poster’s issue is… there is a find_library() earlier in Projucer-generated CMakeLists.txt for each of the user libraries, and they must be working properly to define the variable version… perhaps they just weren’t for the original poster? Maybe not specifying the library path in the extra library search paths in the Debug/Release targets?
Incidentally, it’s the square brackets which break it… works fine with double quotes.
As @sonosaurus mentioned, the square brackets break my multi-arch builds, deleting them and using just the variable name associated with the library is perfectly fine. Yes I’m using the ${ANDROID_ABI} variable.
My case was about linking mosquitto, OpenSSL and crypto
The original CMakeLists.txt which makes an app that cannot find libmosquitto.so:
It did seem so at first. I had this set up running and building an app, then decided to share my finding on the forum. Once I did that and came back to the build to try a few more times it didn’t work anymore. At this point I’m very confused and not being able to run the app without crashing on start on any android device or the android VM.
Let’s put it on hold, I’ll try to solve my issues and then will confirm if the removal of square brackets helps.
Is there a clear tutorial anywhere that would instruct me how to setup the ProJucer project, so that nothing has to be changed manually in the Android CMakeLists.txt file?