PDA

View Full Version : QT + QCA + OpenSSL Plugin + Windows 7



jm
31st May 2010, 15:10
Hello,
I really need your help.
I have a windows 7 (32 bit) system and use qt 4.6.2 with eclipse CDT Release 3.5.2 and MinGW 5.1.6.

Now I want to add the QCA crypto libs.
For that I downloaded:
- vcredist_x86.exe
- Win32OpenSSL-0_9_8n.exe
- qca-2.0.1-mingw.zip
- qca-ossl-2.0.0-beta3.tar.bz2

First I installed the Visual C++ 2008 Redistributable Package (vcredist_x86.exe) to install OpenSSL.
Second I installed OpenSSL to C:\OpenSSL.
Third I unpacked the qca-2.0.1-mingw.zip to C:\qca-2.0.1-mingw. Then I fixed the crypto.prf.in from this:
...
INCLUDEPATH += $$QCA_INCDIR/QtCrypto
LIBS += -L$$QCA_LIBDIR
LINKAGE = -lqca
CONFIG(debug, debug|release) {
windows:LINKAGE = -lqcad
mac:LINKAGE = -lqca_debug
}
...

to this:
...
INCLUDEPATH += $$QCA_INCDIR/QtCrypto
LIBS += -L$$QCA_LIBDIR
LINKAGE = -lqca2
CONFIG(debug, debug|release) {
windows:LINKAGE = -lqcad2
mac:LINKAGE = -lqca_debug
}
...
because the new qca libs called qca2 and not qca.
After that I ran the installwin.bat.

Fourth I unpacked the qca-ossl-2.0.0-beta3.tar.bz2 to C:\qca-ossl-2.0.0-beta3.
I fixed the qca-ossl.cpp file by adding the line:
#undef OBJ_whirpool
Then I ran the configwin.bat like this: configwin rd
After that I ran qmake and then make.
At the end I added the directory crypto to the plugins folder of my QT path (C:\Qt\4.6.2\plugins\crypto) and copied the qca-ossl2.dll and qca-ossld2.dll from the qca-ossl-2.0.0-beta3\lib folder to the plugin\crypto folder.

Everything worked with here. But now I want to use the QCA - libs in my application.
I wrote a little helloWorld Gui like this:


#include "helloworldtestqt.h"
#include <QtGui>
#include <QApplication>
#include <QtCrypto>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
HelloWorldTestQt w;
w.show();
return a.exec();
}

and created the following pro file:
TEMPLATE = app
TARGET = HelloWorldTestQt
QT += core gui
HEADERS += helloworldtestqt.h
SOURCES += main.cpp \
helloworldtestqt.cpp
FORMS += helloworldtestqt.ui
RESOURCES +=
DEFINES += QT_NO_CAST_FROM_ASCII

CONFIG += crypto

but when I compile my application now with eclipse I get the following output (see attachment for more details):
.......
../../Qt/qca-2.0.1-mingw/include/QtCrypto/qca_core.h:882: note: QCA::Provider::Context::Context(QCA::Provider*, const QString&)
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make[1]: Leaving directory `C:/workspace/HelloWorldTestQt'
mingw32-make: *** [debug] Error 2

What did I wrong? Did I forget anything (setting pahtes, variables, ....)?

Thank you for your help.

Jenny