I faced a similar situation: qca-ossl builds fine on linux and not windows at all. I just hit a breakthrough that can help you.
Versions and bug fixes
- qtsdk-2010.05
- KKA-2.0.3
- qca-ossl-r1190163 (from the repository)
- Openssl-1.0.0b
First of all, if you are using a newer version (0.9.7+, I think) of OpenSsl, you may need to use the qca-ossl version from the repository, as it fixes some incompatibilities. I also needed to comment on some lines in the new qca-ossl.cpp file regarding SHA224, SHA256, SHA384 and SHA512 to avoid build errors. I use qca-ossl for ciphers, so I donβt worry about hashing and I donβt know much about errors.
Fixation
There were a lot of problems with creating windows, but most of them are related to the untidy installation of the assembly for the version of Windows for the plugin. It's nice to have a small script configuration for the Linux side of things, but what about windows? We need to do a little extra work.
Some of these additional works are related to the fact that I chose non-standard locations for the support libraries of my application. Qca and OpenSsl exist in the project directory structure in the libraries / directory. I assume you did something similar if you were trying to cross-compile your application, but even if the following didn't help you.
Search OpenSsl
Qca-ossl will not work very well if it cannot find the library to which it should connect ... :) So let's directly indicate where it is. Comment on the lines related to winlocal.prf and the changes that arise from it in qca-ossl.pro. We will directly indicate where to find openSsl.
TEMPLATE = lib CONFIG += plugin QT -= gui DESTDIR = lib VERSION = 2.0.0 unix:include(conf.pri) windows:CONFIG += crypto windows:include(conf_win.pri) CONFIG += create_prl SOURCES = qca-ossl.cpp windows:{ # Rather than rely on the winlocal.prf file, we will specify the location of the openssl # by hand when running qmake. # # load(winlocal.prf) # isEmpty(WINLOCAL_PREFIX) { # error("WINLOCAL_PREFIX not found. See http://delta.affinix.com/platform/#winlocal") # } # # OPENSSL_PREFIX = $$WINLOCAL_PREFIX DEFINES += OSSL_097 INCLUDEPATH += $$OPENSSL_PREFIX/include LIBS += -L$$OPENSSL_PREFIX/lib LIBS += -llibeay32 -lssleay32 LIBS += -lgdi32 -lwsock32 } !debug_and_release|build_pass { CONFIG(debug, debug|release) { mac:TARGET = $$member(TARGET, 0)_debug windows:TARGET = $$member(TARGET, 0)d } }
We now have direct access to the $$ OPENSSL_PREFIX environment variable in the .pro file. We can install it when we call qmake by doing the following.
qmake.exe "OPENSSL_PREFIX=C:/path/to/openssl-1.0.0b"
You can use backslash or slash. Here I choose forward, since Qt rejects them from 4.7.
Alternatively, you can set the OPENSSL_PREFIX variable directly in the .pro file.
Search Qca
After comparing unix and windows files for qca-ossl, oddly enough, it never includes qca libraries for building or linking!?!?! This led to a "Undefined interface" error in the Q_INTERFACES (QCAPlugin) line of the opensslPlugin class definition at the end of qca-ossl.cpp.
To avoid this, we need to explicitly define the input paths and libraries manually. Expanding along the qmake line from the last section, the last qmake line looks like this.
qmake.exe "OPENSSL_PREFIX=C:/path/to/openssl-1.0.0b" "INCLUDEPATH+=C:/path/to/qca-2.0.3/include/QtCrypto" "LIBS+=-LC:/path/to/qca-2.0.3/lib -lqca2"
"Installation" Qca-ossl
After running the qmake line above and starting a simple ol-make, you need to install Qca-ossl. You can copy the resulting dll from the lib / directory to the Qt plugins directory, which if you use my default versions is C: \ Qt \ 2010.05 \ qt \ plugins \ crypto. Alternatively, you can move it to the crypto directory, which is at the root level of the structure of your project, for example, C: \ path \ to \ my \ project \ crypto.
Hope this helps!