How can i deploy a application with QCA library
-
my application need ras and aes algorithm,so i use the QCA(Qt Cryptographic Architecture) ,
then i follow the steps,and get two dll named qca2.dll and qca-ossl2.dll,so i can use them called the algorithm funtions and get the right result on my own pc.
but the problem is that it can not run other's computers, i have logger it and find that the QCA's funtion do not run.
so i can not deploy my application to others .
please help me,thanks. -
See "that":http://delta.affinix.com/qca/ in the section How does it work?.
You need to provide plugins with QCA so that it works properly. Those plugins must be placed in a 'crypto' subfolder of one of the folders in the Qt library paths. -
but how can i provide the QCA plugins with QT sdk properly.
i only put a ‘crypto’ subfolder into the the path"QtSDK\Desktop\Qt\4.8.1\mingw\plugins",
and copy "crypto.prf" and "winlocal.prf" in the path "QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\features".in my pro,
i do the below:
#QT += crypto
QT += crypto.prf
but the creator can not know it.so i put the lib and headers in my project without QT sdk like this below:
INCLUDEPATH += $$quote(qca-2.0.3/include/QtCrypto)
win32 {
LIBS += -L$$quote(qca-2.0.3/lib) -lqca2
}
unix {
LIBS += -L$$quote(qca-2.0.3/lib) -lqca
}this link is releated with "http://www.essentialunix.org/index.php?option=com_content&view=article&id=48:qcatutorial&catid=34:qttutorials&Itemid=53http://".
without QT sdk
.
in my computer the QCA works fine.but when i copy the release folder with needed dlls(QT dlls and QCA dlls(qca2.dll,qca-ossl2.dll,libeay32.dll,ssleay32.dll)) in other computer.it can not run.
so i log it and find that when the QCA's Funtions is called and panic it .so i guess it can not loaded in other computer.
so i do not know that why the QT complier can not load the QCA but it can load its internal Plugins.please tell me how can i run it in others computer without QT sdk anything.
-
the post aboved.have a mistake.
#QT += crypto
QT += crypto.prfit is right here:
#CONFIG += crypto.prf
CONFIG += crypto
so when adding this ,it will compile with QT sdk.but it is not useful for moving other computer.it also can not run other computers.
everyone help me ,thanks a lot.
-
If you deploy your application, e.g. in C:\myapp, you should create new folder in this path (you can call it "plugins"). In that new folder you create other directories for external Qt plugins you need (e.g. "crypto" for QCA). Then you place required dll's there. After that, you sholud create file qt.conf in main directory (where exe resides), which sould contain following content:
@[Paths]
Plugins = plugins@To sum up, paths may look like this:
C:\myapp - main folder
C:\myapp\myapp.exe - executable
C:\myapp\qt.conf - configuration file with paths
C:\myapp\plugins - directory containing plugin folders
C:\myapp\plugins\crypto - directory with QCA dlls -
thanks,i have resolved it.
with the line below:
#CONFIG += crypto.prf
CONFIG += cryptothe resolved ways:
eg:
C:\myapp is my root folder;
so
executable
C:\myapp\myapp.exe – executableqt's dll
c:\myapp\QtCore4.dll ---qt's dll
....
c:\myapp\QtGui4.dll ---qt's dllQCA'S dll
c:\myapp\qca2.dll,qca-ossl2.dll,libeay32.dll,ssleay32.dllQT's plugins
(here you can copy QT's plugins to your root folder)
c:\myapp\plugins\codecs
....
c:\myapp\plugins\sqldrivers
c:\myapp\plugins\crypto(here must be contain the QCA's DLL for load)so the all needed dlls are completion.
you must write code below:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);//set the loading plugins path. qApp->addLibraryPath(qApp->applicationDirPath()); qApp->addLibraryPath(qApp->applicationDirPath() + "/plugins"); //init QCA dll QCA::Initializer init;
QTextCodec::setCodecForLocale(QTextCodec::codecForLocale());
QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
QTextCodec::setCodecForTr(QTextCodec::codecForLocale());BankClient w;
w.show();
return a.exec();
}so you can run the application in any window PC wihout creator.
so there are your deploying componts.at last i must thank maciek ,
he offer a config file "qt.conf" to set the libray path .
like with my code aboved.
i have not try this method.
i think it is a good way mentioned in QT sdk help.http://qt-project.org/doc/qt-4.8/deployment-windows.html
http://qt-project.org/doc/qt-4.8/qt-conf.htmlbut there is a questions about QCA????
the qca's dll have two paths.
1.c:\myapp
2.c:\myapp\plugins
if i delete any of it ,the application will not run.
so it is a question for me ,
Is any one know why does it.