Hi all!
I just wanted to try Crypto++.
So I compiled it successfully on Linux (Slackware), gcc version 3.3.4
I tried the following (at the bottom) simple code (it does nothing useful yet) from the FAQ and tried to compile it with: g++ -o test -I../software/crypto -lcryptopp cr.cpp 2> err
It finds the libcryptopp.a, but gives me hundreds of linker errors, starting with:
--- STARTING WITH ---
/tmp/ccfbhSpx.o(.text+0xca): In function `void CryptoPP::CheckedSetKey<CryptoPP::BlockCipherFinal<(CryptoPP::Ci
: undefined reference to `CryptoPP::SimpleKeyedTransformation<CryptoPP::BlockTransformation>::ThrowIfInvalidKey
/tmp/ccfbhSpx.o(.text+0xde): In function `void CryptoPP::CheckedSetKey<CryptoPP::BlockCipherFinal<(CryptoPP::Ci
: undefined reference to `CryptoPP::Rijndael::Base::UncheckedSetKey(CryptoPP::CipherDir, unsigned char const*,
/tmp/ccfbhSpx.o(.gnu.linkonce.t._ZN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9C
: undefined reference to `CryptoPP::CipherModeBase::SetKey(unsigned char const*, unsigned, CryptoPP::NameValueP
/tmp/ccfbhSpx.o(.gnu.linkonce.t._ZN8CryptoPP14MakeParametersIPKhEENS_19AlgorithmParametersINS_18NullNameValuePa
: undefined reference to `CryptoPP::g_nullNameValuePairs'
/tmp/ccfbhSpx.o(.gnu.linkonce.r._ZTVN8CryptoPP19AlgorithmParametersINS_18NullNameValuePairsEPKhEE+0x10): undefi
/tmp/ccfbhSpx.o(.gnu.linkonce.r._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_
..........more here.............
--- ENDING WITH ---
/tmp/ccfbhSpx.o(.gnu.linkonce.t._ZN8CryptoPP20StreamTransformationD2Ev+0xb): In function `CryptoPP::StreamTrans
: undefined reference to `vtable for CryptoPP::StreamTransformation'
/tmp/ccfbhSpx.o(.gnu.linkonce.t._ZN8CryptoPP25SimpleKeyedTransformationINS_19BlockTransformationEEC2ERKS2_+0x35
: undefined reference to `vtable for CryptoPP::SimpleKeyedTransformation<CryptoPP::BlockTransformation>'
/tmp/ccfbhSpx.o(.gnu.linkonce.t._ZN8CryptoPP25SimpleKeyedTransformationINS_19BlockTransformationEEC2ERKS2_+0x41
: undefined reference to `vtable for CryptoPP::SimpleKeyedTransformation<CryptoPP::BlockTransformation>'
/tmp/ccfbhSpx.o(.gnu.linkonce.t._ZN8CryptoPP19BlockTransformationC2ERKS0_+0x1c): In function `CryptoPP::BlockTr
: undefined reference to `vtable for CryptoPP::BlockTransformation'
collect2: ld returned 1 exit status
--- END LINKER ERRORS ---
/* Compiled with: g++ -o test -I../software/crypto -lcryptopp cr.cpp 2> err */ #include "../software/crypto/modes.h" #include "../software/crypto/aes.h" #include <stdlib.h> #include <iostream>
using namespace CryptoPP;
int main(int argc, char** argv) {
byte key[AES::DEFAULT_KEYLENGTH];
byte iv[AES::BLOCKSIZE];
{
for (int i=0; i<AES::DEFAULT_KEYLENGTH; i++) {
key[i]=0x00;
}
}
CFB_Mode<AES >::Encryption cfbEncryption(key, AES::DEFAULT_KEYLENGTH, iv); // Error here ???
return 0;
}
could anybody help me with this??? I tried for two days now...
bye! Dominik
