clickMe
clickMe

Reputation: 1045

Build Qt static from source enabling OpenSSL support

I followed the instructions for the Qt static build as described in https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW. Running the script on my Windows 10 machine just works fine and builds Qt statically. However, since I require OpenSSL support I can not compile my program with the static build produced from the .psscript.

Therefore, I slightly changed the configure.bat options of the .ps script from -no-openssl to

-openssl-linked 
-I C:\OpenSSL-Win32\include 
-L C:\OpenSSL-Win32\lib\VC\static 
OPENSSL_LIBS="-lUser32 -lAdvapi32 -lGdi32 -lCrypt32"             
OPENSSL_LIBS_DEBUG=-"lssleay32MTd -llibeay32MTd" 
OPENSSL_LIBS_RELEASE="-lssleay32MT -llibeay32MT

to enable OpenSSL support in a static Qt build, based on the anwseres from:

QT https SSL support for static QT static program build - getting 'Protocol "https" is unknown'

and

Is there any way to building static Qt with static OpenSSL?

Running the script now produces not further specified errors in the make install steps. The -lUser32 -lAdvapi32 -lGdi32 -lCrypt32 libs are not in any subfolder of my OpenSSL-Win32 installation but can be found in C:\Windows\System32\.

Upvotes: 0

Views: 1077

Answers (1)

Alexander V
Alexander V

Reputation: 8718

I interpret the question as:

How can I build Qt static from source enabling OpenSSL support at the project installation target?

One of possible ways is:

  • Static Qt build: configure -static -debug-and-release -openssl -I %OPENSSL_HOME%\include -L %OPENSSL_HOME% and more options
  • Link the project executable with same SSL at %OPENSSL_HOME%
  • Distribute the corresponding libeay32.dll and ssleay32.dll altogether with the rest of executables

Upvotes: 0

Related Questions