after a bit of toiling and experimentation I finally fixed the issue. here is how I solved it in case someone else had the same problem, or in case someone else has a better suggestion to fix it:
1) I copied libcrypto.a and libssl.a to my <qtdir>\lib
2) i copied the openssl directory from outinc to <qtdir>\include
3) I noticed that the OPENSSL_LIBS option would not work. It would always error out if I added this option to the configure command when reconfiguring Qt. Upon further investigation, I found that this line was hard coded in <qtdir>\tools\configure\configureapp.cpp:
\\line 2400
else if (dictionary[ "OPENSSL" ] == "linked")
qmakeVars
+= QString("OPENSSL_LIBS = -lssleay32 -llibeay32");
\\line 2400
else if (dictionary[ "OPENSSL" ] == "linked")
qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32");
To copy to clipboard, switch view to plain text mode
I changed it to this:
\\line 2400
else if (dictionary[ "OPENSSL" ] == "linked")
qmakeVars
+= QString("OPENSSL_LIBS = -lssl -lcrypto");
\\line 2400
else if (dictionary[ "OPENSSL" ] == "linked")
qmakeVars += QString("OPENSSL_LIBS = -lssl -lcrypto");
To copy to clipboard, switch view to plain text mode
I then ran the command to configure Qt for what I needed:
configure -release -opensource -static -openssl-linked -webkit
-nomake examples -nomake demos -no-qt3support
-no-style-plastique -no-style-cleanlooks -no-style-motif
-no-style-cde -no-style-windowsce -no-style-windowsmobile
-no-phonon -no-dsp -no-vcproj -no-incredibuild-xge
-no-opengl -no-scripttools -no-sql-sqlite -platform win32-g++
and then:
After this was done, I was able to compile my apps like normal with Qt and openssl static as long as I followed the following steps:
1: run qmake
2: go in the make file it generates and alter the "Libs =" entry by changing
"-lssleay32 -llibeay32" to "-lssl -lcrypto" . Also it is a must that -lgdi32 is moved
to be after "-lssl -lcrypto" in the list.
3: run make, and everything works as it should, the only DLL needed now is mingwm10.dll
My only questions now are:
Is there a way to achieve this without editing configureapp.cpp?
Is there a way for qmake to put the "-lssl -lcrypto" by itself instead of "-lssleay32 -llibeay32" (and making sure that gdi32 is after them)?
Bookmarks