On Monday, January 4, 2016 at 3:51:07 PM UTC-5, Jeffrey Walton wrote: > > > I have two sets of issues. One seems to be linker related: > > > > E/art ( 8857): dlopen("/data/app/com.app/lib/arm/libcryptopp-and.so", > > RTLD_LAZY) failed: dlopen failed: library "libstlport_shared.so" not > found > > > > So I add: > > > > ANDROID_EXTRA_LIBS += > /Users/jhihn/Downloads/android-ndk-r10e/sources/cxx-stl/ > > stlport/libs/armeabi-v7a/libstlport_shared.so > > > > This is always a point of frustration (for me)... How to get the libraries > copied properly and in the right place in the lib/ folder. Under NDK-build, > you use LOCAL_MODULE and LOCAL_SHARED_LIBRARIES. One ensures you > compile/link against a library like stlport_shared, the other ensures > stlport_shared is included in the libs/ directory. > > Also see this Android.mk: > http://github.com/noloader/Android-PRNG/blob/master/jni/Android.mk. It > produces a prng.so called by Java, and it uses stlport_shared.so and > cryptopp.so. > > I’m not sure how Qt does things. > > ***** > > Also note that getting the dlopen flags correct can be challenging. I use > the following code (when needed) code because something that works on one > platform does not work on another (from > http://cryptopp.com/wiki/Linux#Note_for_Shared_Object_Callers): > > void* cryptlib = NULL; > > cryptlib = dlopen("libcryptopp.so", RTLD_GLOBAL); > > if(!cryptlib) > cryptlib = dlopen("libcryptopp.so", RTLD_GLOBAL | RTLD_LAZY); > > if(!cryptlib) > cryptlib = dlopen("libcrypto++.so", RTLD_GLOBAL); > > if(!cryptlib) > cryptlib = dlopen("libcrypto++.so", RTLD_GLOBAL | RTLD_LAZY); > > if(!cryptlib) > throw runtime_error("Failed to load crypto++ shared object"); > > ... > > dlclose(cryptlib); > > > I think you figured it out for me, I need RTLD_GLOBAL in the dlopen() qt-generated android activity to load the library so that crypto++ can access it. Be default it is only specifying RTLD_LAZY
-- -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com. More information about Crypto++ and this group is available at http://www.cryptopp.com. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to cryptopp-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.