PDA

View Full Version : QxtBlowfish how to use?



triperzonak
23rd February 2009, 10:09
hi im trying to use qxtcrypto to encrypt and decrypt but im having trouble using the class QxtBlowfish

in my code


#include <QxtBlowfish>
#include <QxtCrypto>

QByteArray var = "junk";

QxtBlowFish crypt;

crypt.setPassword(var);

var = crypt.encrypt(var);

var = crypt.decrypt(var);


i got undefine errors


build/dialogimpl.o(.text+0x10db):dialogimpl.cpp: undefined reference to `QxtBlowFish::QxtBlowFish(QObject*)'
build/dialogimpl.o(.text+0x1105):dialogimpl.cpp: undefined reference to `QxtBlowFish::setPassword(QByteArray)'
build/dialogimpl.o(.text+0x1153):dialogimpl.cpp: undefined reference to `QxtBlowFish::encrypt(QByteArray)'
build/dialogimpl.o(.text+0x11c4):dialogimpl.cpp: undefined reference to `QxtBlowFish::decrypt(QByteArray)'
build/dialogimpl.o(.text+0x17cf):dialogimpl.cpp: undefined reference to `QxtBlowFish::~QxtBlowFish()'
build/dialogimpl.o(.text+0x210b):dialogimpl.cpp: undefined reference to `QxtBlowFish::QxtBlowFish(QObject*)'
build/dialogimpl.o(.text+0x2135):dialogimpl.cpp: undefined reference to `QxtBlowFish::setPassword(QByteArray)'
build/dialogimpl.o(.text+0x2183):dialogimpl.cpp: undefined reference to `QxtBlowFish::encrypt(QByteArray)'
build/dialogimpl.o(.text+0x21f4):dialogimpl.cpp: undefined reference to `QxtBlowFish::decrypt(QByteArray)'
build/dialogimpl.o(.text+0x27ff):dialogimpl.cpp: undefined reference to `QxtBlowFish::~QxtBlowFish()'


heres my .pro



INCLUDEPATH += "C:\libqxt\include\Qxt"
LIBS += -L"C:\libqxt\lib\" -lQxtCrypto
CONFIG += qxt
QXT += crypto

i did try to include the other libs but nothing happen.. what am i missing?

jpn
23rd February 2009, 10:25
Could you paste the linker output? Oh, and


CONFIG += qxt
QXT += crypto

should be enough provided that the installation of the library succeed.

triperzonak
23rd February 2009, 10:34
when im building it this errors show..

by the way im using windows is it necessary to install openssl?


Build (make)...
c:\Qt\4.4.3\bin\qmake.exe -win32 -o Makefile tryedfile.pro
C:/Qt/4.4.0/bin/mingw32-make.exe -f Makefile.Release
mingw32-make.exe[1]: Entering directory `C:/Documents and Settings/RD/Desktop/projects/tryedfile'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -Wl,-subsystem,console -o bin\tryedfile.exe build/dialogimpl.o build/main.o build/moc_dialogimpl.o -L"c:\Qt\4.4.3\lib" -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtCore -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lws2_32
mingw32-make.exe[1]: Leaving directory `C:/Documents and Settings/RD/Desktop/projects/tryedfile'
build/dialogimpl.o(.text+0x10db):dialogimpl.cpp: undefined reference to `QxtBlowFish::QxtBlowFish(QObject*)'
build/dialogimpl.o(.text+0x1105):dialogimpl.cpp: undefined reference to `QxtBlowFish::setPassword(QByteArray)'
build/dialogimpl.o(.text+0x1153):dialogimpl.cpp: undefined reference to `QxtBlowFish::encrypt(QByteArray)'
build/dialogimpl.o(.text+0x11c4):dialogimpl.cpp: undefined reference to `QxtBlowFish::decrypt(QByteArray)'
build/dialogimpl.o(.text+0x17cf):dialogimpl.cpp: undefined reference to `QxtBlowFish::~QxtBlowFish()'
build/dialogimpl.o(.text+0x210b):dialogimpl.cpp: undefined reference to `QxtBlowFish::QxtBlowFish(QObject*)'
build/dialogimpl.o(.text+0x2135):dialogimpl.cpp: undefined reference to `QxtBlowFish::setPassword(QByteArray)'
build/dialogimpl.o(.text+0x2183):dialogimpl.cpp: undefined reference to `QxtBlowFish::encrypt(QByteArray)'
build/dialogimpl.o(.text+0x21f4):dialogimpl.cpp: undefined reference to `QxtBlowFish::decrypt(QByteArray)'
build/dialogimpl.o(.text+0x27ff):dialogimpl.cpp: undefined reference to `QxtBlowFish::~QxtBlowFish()'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [bin\tryedfile.exe] Error 1
mingw32-make.exe: *** [release] Error 2
---------------------- Build finished with 2 error(s) ----------------------

jpn
23rd February 2009, 11:00
Yes, OpenSSL is mandatory. You have to pass suitable -L, -l and -I parameters to the configure script. For example something like:


configure.bat -I C:\OpenSSL\include -L C:\OpenSSL\lib -l eay32 -l ssleay32

The configure script will output whether OpenSSL tests failed or passed. You can check config.log for details.

triperzonak
24th February 2009, 02:41
thanks.. but i got errors now.. i think my qxt0.4 is not up to date because the example functions on the net are different.

jpn
24th February 2009, 15:04
QxtBlowfish API got cleaned up quite recently. The last release differs from what's in the version control system.

triperzonak
25th February 2009, 01:12
where can i get the latest release bro?.. and what version of openSSL should i use?

jpn
25th February 2009, 10:55
You can for example download it from http://hg.libqxt.org/.