can't link correctly static openssl libraries
-
Hello!
I have a cross-platform application which uses openssl for encryption, i used static libraries(crypto and ssl) which i added in CMake based on running os, it works on macos, ios, android but on windows not. the library works because i used g++ to compile a simple .cpp without errors.here i include libs
if(WIN32) target_link_libraries(appmy_qt PUBLIC ${A_DIR_MODULE_ROOT}/platform/windows/lib/libcrypto.lib ${A_DIR_MODULE_ROOT}/platform/windows/lib/libssl.lib ) endif()
C:/Internship2023/qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/appmy_qt.dir/security/cryptography.cpp.obj: in function
Cryptography::createPrivateRSA(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': C:/Internship2023/my_qt/security/cryptography.cpp:35: undefined reference to
BIO_new_mem_buf'
C:/Internship2023/qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Internship2023/my_qt/security/cryptography.cpp:40: undefined reference to `PEM_read_bio_RSAPrivateKey'Did anyone encounter this problem before?
-
Hello!
I have a cross-platform application which uses openssl for encryption, i used static libraries(crypto and ssl) which i added in CMake based on running os, it works on macos, ios, android but on windows not. the library works because i used g++ to compile a simple .cpp without errors.here i include libs
if(WIN32) target_link_libraries(appmy_qt PUBLIC ${A_DIR_MODULE_ROOT}/platform/windows/lib/libcrypto.lib ${A_DIR_MODULE_ROOT}/platform/windows/lib/libssl.lib ) endif()
C:/Internship2023/qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/appmy_qt.dir/security/cryptography.cpp.obj: in function
Cryptography::createPrivateRSA(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': C:/Internship2023/my_qt/security/cryptography.cpp:35: undefined reference to
BIO_new_mem_buf'
C:/Internship2023/qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Internship2023/my_qt/security/cryptography.cpp:40: undefined reference to `PEM_read_bio_RSAPrivateKey'Did anyone encounter this problem before?
@vofr said in can't link correctly static openssl libraries:
${A_DIR_MODULE_ROOT}/platform/windows/lib/libcrypto.lib
These are MSVC import libs.