Für den Code:libcrypto ++ in Linux
#include <fstream>
#include <iostream> //cryptopp libraries
#include "cryptopp/dll.h"
#include "cryptopp/default.h"
using namespace std;
using namespace CryptoPP;
int main()
{
byte key[AES::DEFAULT_KEYLENGTH], iv[AES::BLOCKSIZE];
// initialize key and iv here
CFB_Mode<AES >::Encryption cfbEncryption(key, AES::DEFAULT_KEYLENGTH, iv);
std::cout << "Hello world!" << std::endl;
return 0;
}
ich die folgenden Fehler, wenn es kompiliert: $: g ++ test.cpp -o tess -lcrypto ++ -lpthread
/tmp/ccLR085h.o :. In Funktion CryptoPP::AllocatorWithCleanup<unsigned char, true>::allocate(unsigned int, void const*)': test.cpp:(.text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE8allocateEjPKv[CryptoPP::AllocatorWithCleanup<unsigned char, true>::allocate(unsigned int, void const*)]+0x2b): undefined reference to
CryptoPP :: AlignedAllocate (unsigned int)‘ test.cpp :(text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE8allocateEjPKv [CryptoPP AllocatorWithCleanup :: :: zuteilen (unsigned int, ungültig const *)] + 0x38): undefined Bezug auf CryptoPP::UnalignedAllocate(unsigned int)' /tmp/ccLR085h.o: In function
CryptoPP: : AllocatorWithCleanup :: deallocate (void *, unsigned int) ': test.cpp :(text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE10deallocateEPvj [CryptoPP AllocatorWithCleanup :: :: DEALLOCATE (void *, unsigned int)] + 0x25). Undefinierten Bezug auf CryptoPP::AlignedDeallocate(void*)' test.cpp:(.text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE10deallocateEPvj[CryptoPP::AllocatorWithCleanup<unsigned char, true>::deallocate(void*, unsigned int)]+0x32): undefined reference to
CryptoPP :: UnalignedDeallocate (void *)‘ collect2: ld ergab 1 Ausfahrt Status
BRAUCHEN SIE HILFE. THX