OpenSSL link issues



  • Hi! I want to link app to OpenSSL libraries. The problem is, it displays the following errors:

    qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
    qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
    qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
    qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
    qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
    qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
    qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
    qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
    qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
    qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
    

    .pro

    win32 {
        contains(QMAKE_TARGET.arch, x86_64) {
           INCLUDEPATH += "C:\\Program Files\\OpenSSL-Win64\\include\\openssl"
           LIBS += -L"C:\\Program Files\\OpenSSL-Win64\\lib" -llibeay32
           LIBS += -L"C:\\Program Files\\OpenSSL-Win64\\lib" -lssleay32
        } else {
           INCLUDEPATH += "C:\\Program Files\\OpenSSL-Win32\\include\\openssl"
           LIBS += -L"C:\\Program Files\\OpenSSL-Win32\\lib" -llibeay32
           LIBS += -L"C:\\Program Files\\OpenSSL-Win32\\lib" -lssleay32
        }
    }
    

    How to fix those issues? Thanks in advance.


  • Lifetime Qt Champion

    Hi,

    Why are you trying to link your application with OpenSSL ?

    The error message you are seeing comes from the fact that your application can't find the OpenSSL .dll files at run time.

    You should go to the Run part of the Project panel and modify the PATH environment variable to add the folder where the OpenSSL dlls for your compiler can be located.



  • @SGaist

    Thanks, but it will only be available to compiler, how to copy/link/include these libraries automatically to files directory?



  • The problem was that I didn't copy these libraries to executable directory. Now it's working.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.