Works fine for me on Ubuntu. If the library is non-standard location you will need to use -L<path>. I didn't manually download crypto++ - I used apt-get...
On Jan 5, 4:30 am, meli <[email protected]> wrote: > HI, > > 0 down vote favorite > > For the code: > > #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; > > } > > I have the following errors when compiling it: $: g++ test.cpp -o tess > -lcrypto++ -lpthread > > /tmp/ccLR085h.o: In function 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 toCryptoPP::AlignedAllocate(unsigned int)' test.cpp: > (.text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE8allocateEjPKv[CryptoPP::AllocatorWithCleanup::allocate(unsigned > int, void const*)]+0x38): undefined reference to > CryptoPP::UnalignedAllocate(unsigned int)' /tmp/ccLR085h.o: In > functionCryptoPP::AllocatorWithCleanup::deallocate(void*, unsigned > int)': test.cpp: > (.text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE10deallocateEPvj[CryptoPP::AllocatorWithCleanup::deallocate(void*, > unsigned int)]+0x25): undefined reference to > CryptoPP::AlignedDeallocate(void*)' test.cpp: > (.text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE10deallocateEPvj[CryptoPP::AllocatorWithCleanup<unsigned > char, true>::deallocate(void*, unsigned int)]+0x32): undefined > reference toCryptoPP::UnalignedDeallocate(void*)' collect2: ld > returned 1 exit status > > NEED HELP. THX -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com.
