After more than two days of building errors, I give up...
I followed this good tutorial here: http://www.cryptopp.com/wiki/Android_(Command_Line) . It compiles, and the "cryptest.exe" passes all tests. So, I guess that the static library "libcryptopp.a" is OK.
So, I move the "libcryptopp.a" and all the headers files in the Android project.
But when it comes to the building step (as often... :-) ), there are compilation errors, like:
.../Classes/libs/android/libcryptopp.a(files.o): in function std::basic_filebuf<char, std::char_traits<char> >::_M_unshift()
[clone .part.40]:/Users/toto/Developer/NDKs/AndroidNDKs/android-ndk-r8e/sources/cxx-stl/stlport/stlport/stl/_fstream.h:322:
error: undefined reference to 'std::_Filebuf_base::_M_write(char*, int)'
and ~50 others ...
"undefined reference to" errors usually mean that a library is not present, but "libcryptopp.a" is correct here. So I expect that something is missing in the "Android.mk":
include $(CLEAR_VARS)
LOCAL_MODULE := cryptopp-prebuilt
LOCAL_SRC_FILES := ...narf/Classes/libs/android/libcryptopp.
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
/*
here are included other library
*/
LOCAL_STATIC_LIBRARIES := cryptopp-prebuilt
include $(BUILD_SHARED_LIBRARY)
After tries with "APP_STL := stlport_static/dynamic", "APP_STL := gnustl_static/dynamic", etc... no more chances.
Being really not a building/compilation expert (even worse on Android), can somebody help me. Thank you very much!
Ok. It is working now!
So the linking of "libcryptopp.a" is not working on my Android project with "stlport" but only with "gnustl_static". Perhaps because of others include like "cocosd2-x".
So following the tuto "http://www.cryptopp.com/wiki/Android_(Command_Line)" you must change the script "setenv-android.sh" to have a result like this:
ANDROID_STL_INC: /Users/toto/Developer/NDKs/AndroidNDKs/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/include/
ANDROID_STL_LIB: /Users/toto/Developer/NDKs/AndroidNDKs/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl_static.a
and also move the files (just for the compilation)
/Users/toto/Developer/NDKs/AndroidNDKs/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include/bits
in
/Users/toto/Developer/NDKs/AndroidNDKs/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/include/bits
otherwise there are compilation problems...
Ouf!
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments