PDA

View Full Version : qca-openssl-2.0.0-beta3 with Visual Studio 2008 / Windows XP: link error



alainstgt
17th February 2013, 17:52
link error with qca-openssl-2.0.0-beta3 with Visual Studio 2008 / Windows XP

Hello!

Ihave encountered some troubles building qca.

First I intalled OpenSSL version 1.0.1e and run the tests. All tests passed!

Secondly I installed QCA version 2.0.3:
# configure --debug --qtdir=c:\dev\qt441. I got the message "Good, your configure finished. Now run nmake", so everything seems OK.
# nmake. No errors or warnings!
# installwin. I got the message "Installed crypto.prf as a qmake feature", so I believe everything went OK.

After having unpacked the qca-openssl package version 2.0.0-beta3 I run:
# 'configwin d' (debug only). I got the message "configuring for debug dynamic. Wrote conf_win.pri", so everything seems OK.
# qmake "OPENSSL_PREFIX=C:\Dev\OpenSSL\101e".
Leads to 4 compile errors: fatal error U1077: some identifier not found in qca-ossl.cpp. All were related to the variable 'EVP_md2'.
So I recompiled OpenSSL with the option 'enable-md2' in configure and run again
# qmake "OPENSSL_PREFIX=C:\Dev\OpenSSL\101e".
This time, everything compiled without errors!
Unfortunately I got a linker error:

link /LIBPATH:"c:\Dev\QT441\lib" /NOLOGO /DEBUG /DLL /VERSION:2.00 /OUT:lib\qca-ossld2.dll @C:\DOKUME~1\Alain\LOKALE~1\Temp\nm1069.tmp
Creating library lib\qca-ossld2.lib and object lib\qca-ossld2.exp
qca-ossl.obj : error LNK2019: unresolved external symbol _EVP_md2 referenced in function "public: virtual void __thiscall opensslQCAPlugin::RSAKey::startSign(enum CA::SignatureAlgorithm,enum QCA::SignatureFormat)" (?startSign@RSAKey@openss lQCAPlugin@@UAEXW4SignatureAlgorithm@QCA@@W4Signat ureFormat@4@@Z)
lib\qca-ossld2.dll : fatal error LNK1120: 1 unresolved externals

How can I sort out this issue?

Thank you for your help.
Alain

alainstgt
19th February 2013, 11:19
in the meanwhile I have found the solution.
qmake does not know where libraries and header files are located. Further I pass also the path of openssl as argument since I had to comment out the section about winlocal.prf in the qca-ossl.pro file.
So the command looks like:

qmake.exe "OPENSSL_PREFIX=C:/path/to/openssl" "INCLUDEPATH+=C:/path/to/qca/include/QtCrypto" "LIBS+=-LC:/path/to/qca/lib *-lqca2" (-lqcad2 for debug)

For those interested in building qca with VisualC++, I have a complete step by step description of the building process (qca-2.0.3 | qca-ossl-2.0.0-beta3 | openssl-1.0.1e | Visual Studio 2008 (VC++ 9). Just drop me a message.