Trying to link with OpenSSL libraries in Windows
Solved
General and Desktop
-
Hello!
I'm making a project which includes a statically linked library which in turn uses OpenSSL.
I have installed 32-bit OpenSSL from https://slproweb.com/products/Win32OpenSSL.html in default folder.
I have added to my static library pro file:INCLUDEPATH += C:/OpenSSL-Win32/include DEPENDPATH += C:/OpenSSL-Win32/include
I have added to my application pro file:
win32: LIBS += -L"C:/OpenSSL-Win32/lib/MinGW/" -leay32
I get:
C:\Qt\projects\build-config-Desktop_Qt_5_4_2_MinGW_32bit-Debug\common/../../config/common/QueryLogic.cpp:650: undefined reference to `AES_set_encrypt_key' C:\Qt\projects\build-config-Desktop_Qt_5_4_2_MinGW_32bit-Debug\common/../../config/common/QueryLogic.cpp:651: undefined reference to `AES_encrypt'
If I change my application pro file to:
win32: LIBS += -L"C:/OpenSSL-Win32/lib/MinGW/" -llibeay32
I get:
C:/Qt/Tools/mingw491_32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -llibeay32
But libeay32.a is there, in C:/OpenSSL-Win32/lib/MinGW/ folder. How do I link with OpenSSL in Windows?
Thanks!
-
Hi,
Do you also have libcrypto in your OpenSSL install ?
-
@azarubkin said:
I have added to my application pro file:
win32: LIBS += -L"C:/OpenSSL-Win32/lib/MinGW/" -leay32
This works for me:
LIBS += C:/OpenSSL-Win32/lib/libeay32.lib