Reputation: 567
Hi I am trying to compile a QT program I made for Windows statically with the openssl libraries compiled into the executable. I thought I succeeded however I can't run the porgram without the Openssl dlls present. I looked all over the net trying to find a solution but couldn't. Here's what I've done:
I passed this to configure.bat by editing the windows powershell script for building qt statically and then run it to build:
-openssl-linked
-I C:\OpenSSL-Win32\include
-L C:\OpenSSL-Win32\lib\MinGW
OPENSSL_LIBS=""-lUser32 -lAdvapi32 -lGdi32 -lCrypt32""
OPENSSL_LIBS_DEBUG=-""-lssleay32 -llibeay32""
OPENSSL_LIBS_RELEASE=""-lssleay32 -llibeay32""
The executable won't work without the openssl dlls now. Am I doing something wrong?
Upvotes: 1
Views: 359
Reputation: 567
Answer from Shining Light Productions:
Dependency Walker will show you what DLLs your executable depends on. The MinGW libraries are "built" using the VC++ DLLs as the source. IIRC, there are no static MinGW builds (why the generated .a files are so massive has always been a mystery to me).
Upvotes: 0
Reputation: 98505
You're linking with the dynamic version of OpenSSL. You should link with the static one instead:
-L C:\OpenSSL-Win32\lib\MinGW\static
Upvotes: 0