I’m trying to compile my Cocos2d-x project with OpenSSL for Android. I can run the project properly on Visual Studio Community 2013, but can’t compile it on the command line with cocos compile -p android --android-studio
.
I installed OpenSSL to path project\cocos2d\external\OpenSSL-Win32 and added the OpenSSL include path to the Android.mk
file:
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../proj.win32 \ $(LOCAL_PATH)/../../../cocos2d/external/OpenSSL-Win32/include
I think I should also add some library references, but I don’t know how.
Currently, I get these errors when I try to compile it to Android:
jni/…/…/…/proj.win32/EncryptionHelper.cpp:61: error: undefined reference to ‘EVP_CIPHER_CTX_new’
jni/…/…/…/proj.win32/EncryptionHelper.cpp:65: error: undefined reference to ‘EVP_aes_256_cbc’
jni/…/…/…/proj.win32/EncryptionHelper.cpp:65: error: undefined reference to ‘EVP_EncryptInit_ex’
jni/…/…/…/proj.win32/EncryptionHelper.cpp:67: error: undefined reference to ‘EVP_EncryptUpdate’
jni/…/…/…/proj.win32/EncryptionHelper.cpp:70: error: undefined reference to ‘EVP_EncryptFinal_ex’
jni/…/…/…/proj.win32/EncryptionHelper.cpp:73: error: undefined reference to ‘EVP_CIPHER_CTX_free’