Unsolved openSSL in QT
-
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.
-
@SGaist yes by adding dll in exe folder im able to post data
but there is anyway to include openssl static? -
@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.
-
@jsulm you say i do not need to set OPENSSL_LIBS?
and by the way i think this 2 lib use for shared version libssl.dll.a & libcrypto.dll.aand also i use mingw to build openssl and Qt
-
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
-
@Markus43 thanks for reply, but i need openssl for static build
-
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.