NDK library name clashes

Put problems with the Android NDK in this forum.

NDK library name clashes

Postby agentq » Mon Mar 21, 2011 9:22 pm


I hope you can help me, this problems has me hitting my head against the table!

I've compiled a version of libpng so I can use it from the NDK (I'm doing this so I can used code ported from another platform). This works perfectly on Android 2.1. I have a libpng.so, and my own library libgl2jni.so (based on the sample)

I load the two libraries like this

Code: Select all

As I said, all is fine on Android 2.1. On Android 1.6 however, the wrong png library is loaded, it seems to load the system's PNG library and not my own! There doesn't seem to be a way of setting the path that these files are loaded. I tried System.load() instead, passing the full path to my version of the .so, but it made no difference, the system .so is still loaded intead.

The header and binary being different versions of libpng obviously causes the code to die.

To fix this, I tried renaming my library to "png141.so". Unfortunately, when executing this, I get the error

Code: Select all
03-21 20:01:58.839: INFO/dalvikvm(531): Unable to dlopen(/data/data/com.android.poo/lib/libgl2jni.so): Cannot load library: link_image[1638]:    30 could not load needed library 'libpng.so' for 'libgl2jni.so' (load_library[984]: Library 'libpng.so' not found)

Even though there are no references to 'libpng.so' in the Android.mk file for my project, and the library under it's original name is not linked to.

Anyone know how to fix the problem?
Once Poster
Once Poster
Posts: 1
Joined: Mon Mar 21, 2011 9:14 pm


Return to NDK Problems

Who is online

Users browsing this forum: No registered users and 2 guests