We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thank you for your service.
I downloaded the built file from the link below and added it to the Android project. https://github.com/leenjewel/openssl_for_ios_and_android/releases/tag/20170105
Now set the corresponding openssl library in CMakeLists.txt.
openssl library
CMakeLists.txt
cmake_minimum_required(VERSION 3.10) set(ZLIB_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/zlib/include") set(ZLIB_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/zlib/lib") set(OPENSSL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/opensslLib/${ANDROID_ABI}/include") set(OPENSSL_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/opensslLib/${ANDROID_ABI}/lib") include_directories( ${OPENSSL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) link_directories(${ZLIB_LIBRARY_DIR}) add_library(ssl STATIC IMPORTED) set_target_properties(ssl PROPERTIES IMPORTED_LOCATION ${OPENSSL_LIBRARY_DIR}/libssl.a) add_library(crypto STATIC IMPORTED) set_target_properties(crypto PROPERTIES IMPORTED_LOCATION ${OPENSSL_LIBRARY_DIR}/libcrypto.a) add_library(curl STATIC IMPORTED) set_target_properties(curl PROPERTIES IMPORTED_LOCATION ${OPENSSL_LIBRARY_DIR}/libcurl.a) # zlib 라이브러리 파일을 찾아서 설정 find_library(ZLIB_LIBRARY z PATHS ${ZLIB_LIBRARY_DIR}) if(NOT ZLIB_LIBRARY) message(FATAL_ERROR "zlib library not found") endif() add_library( native-lib # Sets the library as a shared library. SHARED # Provides a relative path to your source file(s). src/main/native/file1.c src/main/native/file2.c ... ) target_link_libraries( native-lib ${ZLIB_LIBRARY} curl ssl crypto android log EGL GLESv1_CM )
When compiling, an error occurs.
../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_expand_block: error: undefined reference to 'inflate' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_compress_block: error: undefined reference to 'deflate' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_finish: error: undefined reference to 'inflateEnd' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_finish: error: undefined reference to 'deflateEnd' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_init: error: undefined reference to 'inflateInit_' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_init: error: undefined reference to 'deflateInit_' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_free: error: undefined reference to 'inflateEnd' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_free: error: undefined reference to 'deflateEnd' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_ctrl: error: undefined reference to 'deflate' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_ctrl: error: undefined reference to 'zError' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_write: error: undefined reference to 'deflate' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_write: error: undefined reference to 'zError' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_write: error: undefined reference to 'deflateInit_' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_read: error: undefined reference to 'inflate' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_read: error: undefined reference to 'zError' ../../../../opensslLib/armeabi-v7a/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_read: error: undefined reference to 'inflateInit_'
Is there any way to solve the problem??
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
No branches or pull requests
Thank you for your service.
I downloaded the built file from the link below and added it to the Android project.
https://github.com/leenjewel/openssl_for_ios_and_android/releases/tag/20170105
Now set the corresponding
openssl library
inCMakeLists.txt
.When compiling, an error occurs.
Is there any way to solve the problem??
The text was updated successfully, but these errors were encountered: