Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. can't link correctly static openssl libraries
Qt 6.11 is out! See what's new in the release blog

can't link correctly static openssl libraries

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vofr
    wrote on last edited by
    #1

    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?

    Christian EhrlicherC 1 Reply Last reply
    0
    • V vofr

      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?

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @vofr said in can't link correctly static openssl libraries:

      ${A_DIR_MODULE_ROOT}/platform/windows/lib/libcrypto.lib

      These are MSVC import libs.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved