openSSL in QT
-
Did you check that you have everything from the right architecture ?
-
i build openssl version 1.1.1d too
and add lib to my project
but still no luck
here my code and error
and also openssl part in pro file
win32: LIBS += -LD:/build/ver-1d-openssl/lib/ -lcrypto win32: LIBS += -LD:/build/ver-1d-openssl/lib/ -lssl INCLUDEPATH += D:/build/ver-1d-openssl/include DEPENDPATH += D:/build/ver-1d-openssl/include
edit: when i add openssl dll in debug folder of my project its work just fine
but i need static -
Your application does not link to OpenSSL nor does Qt by default.
As for when running your application, the dlls must be findable. The usual way is to copy the files in the same folder as your application or modify the PATH environment variable in the Run part of the Project panel.
-
@saeid0034 said in openSSL in QT:
but there is anyway to include openssl static?
Not without building Qt by yourself as normal Qt builds load OpenSSL libs at runtime.
-
@jsulm can anyone tell me i need to pass what in ./configure to build qt with openssl statically
i use this for build qt static for nowconfigure -opensource -confirm-license -static -platform win32-g++ -optimize-size -opengl desktop -prefix "C:\Qt\static" -skip webengine -nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -qt-tiff
i need to add what to build qt static + openssl?
edit: i see this page in wiki
based of this page i need to build qt like thisOPENSSL_LIBS='-L/d/build/ssl/lib -lssl -lcrypto' && configure -opensource -confirm-license -static -platform win32-g++ -openssl-linked -optimize-size -opengl desktop -prefix "C:\Qt\static" -skip webengine -nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -qt-tiff
in this configure OPENSSL_LIBS is Location of openssl-1.1.1g i compiled before (with mingw)
its all ok?
-
@saeid0034 said in openSSL in QT:
OPENSSL_LIBS='-L/d/build/ssl/lib -lssl -lcrypto
This looks like linking against shared OpenSSL libs.
-
You don't need to rebuild Qt. Just select OpenSSL in the installer, and do what is suggested here:
https://stackoverflow.com/questions/59507538/install-openssl-for-msvc2017-on-64-bit-windows-10
-
Then the question is: Does OpenSSL need to be static, too?
If you can live with using OpenSSL dlls while using static Qt, you can just add the following to your configure line (also with OpenSSL from the installer) and you're done.
e.g. for x86 builds:-openssl -I C:\Qt\Tools\OpenSSL\Win_x86\include -L C:\Qt\Tools\OpenSSL\Win_x86\lib
-
@Markus43 said in openSSL in QT:
Then the question is: Does OpenSSL need to be static, too?
If you can live with using OpenSSL dlls while using static Qt, you can just add the following to your configure line (also with OpenSSL from the installer) and you're done.
e.g. for x86 builds:-openssl -I C:\Qt\Tools\OpenSSL\Win_x86\include -L C:\Qt\Tools\OpenSSL\Win_x86\lib
for using openssl static too i need to build Qt static with openssl again?
-
@saeid0034 said in openSSL in QT:
for using openssl static too i need to build Qt static with openssl again?
Yes. Think about it: when linking against dlls, the linker only links the OpenSSL function calls in a way that they call the dll. When linking against static OpenSSL, the linker copies the called functions' code into the executable being built.
Anyhow, I never did a static build of OpenSSL, so I'm not sure if the line above works for static builds, too.