编译及安装QCA类库

Follow below steps: 

1. download qca-2.0.3.tar.bz2 and qca-ossl-2.0.0-beta3.tar.bz2
2. open pro file in each project, build them with Qt Creator respectively
(note, build them always in release mode, because we don't want to debug them later and release mode can avoid some build issues)
===build qca:=== 
1) folow instructions in INSTALL file, run command "configure.exe --qtdir=d:\work\cpp\program\QtSDK\Desktop\Qt\4.7.4\mingw\"
2) open pro file by Qt Creator, build
===build qca-ossl(qca-ossl depends on qca project build and OpenSSL head/library)===
0)install microsoft visual c++ redistributable
1)install OpenSSL for windows
http://www.slproweb.com/products/Win32OpenSSL.html
Win32 OpenSSL v1.0.0g 16MB Installer
2)create folder local in C:\ root, create sub folder bin,include and lib
3)copy OpenSSL include and lib files to C:\local, rename C:\local\lib\*.a to *.lib
4)create winlocal.prf by command "echo "WINLOCAL_PREFIX = C:/local" > %QTDIR%\mkspecs\features\winlocal.prf"
5) copy %QCADIR%/crypto.prf to  %QTDIR%\mkspecs\features
6) download qca-ossl.cpp from http://www.essentialunix.org/downloads/qca-ossl.cpp, (this version works)
7) open cmd.exe, folow README file, execute command "configwin.bat r" and "qmake"(this will generate moc file)
8) open pro file in Qt Creator, find line "LIBS += -L$$OPENSSL_PREFIX/lib/", add "MinGW" behind this line
9)open pro file by Qt Creator, build
10)Done! you will get qca-ossl2.dll under folder lib
notes:
when you get errors like "cannot find file -lqcad", 
try to edit crypto.prf file find that string and change them to correct one
(note, qca souce debug mode will add letter 'd' after each library name)
3. copy lib/*.dll from each project to D:\work\cpp\program\QtSDK\Desktop\Qt\4.7.4\mingw\plugins\crypto
4. add CONFIG+=crypto.prf in your pro file
5. copy libeay32.dll,ssleay32.dll,qca2.dll,qca-ossl2.dll to your project/debug(or release) folder.
6. copy folder qca-2.0.3\include\QtCrypto to your project folder, you need include QtCrypto header file in your source.
7. Done!

原文地址:https://www.cnblogs.com/andy65007/p/2372308.html