He is using MS toolchain. But it does seem like cryptopp is not linked at all.
Make sure to set dependency (aestest project on cryptopp) if it is part of your solution, or explicitly link to the lib if it is not. > that seems to be a problem with your linking. > > Are you linking against libcrypto.a or using the flag -lcrypto? > > On Dec 3, 7:57 am, K~F~C <[email protected]> wrote: > >> I'm trying to use the Crypto++(cryptoLib5.6.0). >> >> the following lines in my coding(aestext.cpp) seems to have some problems. >> I meet the following error messages when I build it. >> >> how to solve this problem.. >> thanks in advance. >> >> ----------- >> #include <iostream> >> #include <iomanip> >> #include "cryptlib.h" >> #include "modes.h" >> #include "aes.h" >> #include "filters.h" >> #include "base64.h" >> >> .... >> ...... >> >> int main(int argc, char* argv[]) { >> >> byte key[CryptoPP::AES::DEFAULT_KEYLENGTH]; >> ..... >> ....... >> byte iv[CryptoPP::AES::BLOCKSIZE]; >> ......... >> ....... >> >> CryptoPP::AES::Encryption >> aesEncryption(key, CryptoPP::AES::DEFAULT_KEYLENGTH); >> CryptoPP::CBC_Mode_ExternalCipher::Encryption >> cbcEncryption(aesEncryption, iv); >> ....... >> ------------- >> error messags: >> >> Linking... >> aestest.obj : error LNK2001: unresolved external symbol "public: virtual >> void __thiscall CryptoPP::StreamTransformation::ProcessLastBlock(unsigned >> char *,unsigned char const *,unsigned int)" >> (?processlastbl...@streamtransformation@CryptoPP@@UAEXPAEP >> b...@z) >> aestest.obj : error LNK2001: unresolved external symbol "public: virtual >> void __thiscall CryptoPP::CBC_Encryption::ProcessData(unsigned char >> *,unsigned char const *,unsigned int)" >> (?processd...@cbc_encryption@CryptoPP@@uaexpaep...@z) >> aestest.obj : error LNK2001: unresolved external symbol "public: virtual >> void __thiscall >> CryptoPP::BlockOrientedCipherModeBase::UncheckedSetKey(unsigned char const >> *,unsigned int,class CryptoPP::NameValuePairs const &)" >> (?uncheckedset...@blockorient >> edciphermodeb...@cryptopp@@uaexpbeiabvnamevaluepa...@2@@Z) >> aestest.obj : error LNK2001: unresolved external symbol "public: virtual >> void __thiscall CryptoPP::SimpleKeyingInterface::GetNextIV(class >> CryptoPP::RandomNumberGenerator &,unsigned char *)" >> (?getnex...@simplekeyinginterface@CryptoPP@@UAEXAAVRandomNu >> mbergenera...@2@p...@z) >> aestest.obj : error LNK2001: unresolved external symbol "public: virtual >> void __thiscall CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const >> *,unsigned int,class CryptoPP::NameValuePairs const &)" >> (?set...@simplekeyinginterface@CryptoPP@@UAE >> xpbeiabvnamevaluepa...@2@@Z) >> aestest.obj : error LNK2001: unresolved external symbol "public: virtual >> unsigned int __thiscall >> CryptoPP::BlockTransformation::AdvancedProcessBlocks(unsigned char const >> *,unsigned char const *,unsigned char *,unsigned int,unsigned int)const " >> (?Adv >> ancedprocessblo...@blocktransformation@CryptoPP@@ubeipbe0pa...@z) >> aestest.obj : error LNK2001: unresolved external symbol "public: virtual >> unsigned int __thiscall >> CryptoPP::BlockTransformation::OptimalDataAlignment(void)const " >> (?optimaldataalignm...@blocktransformation@CryptoPP@@UBEIXZ) >> aestest.obj : error LNK2001: unresolved external symbol "public: virtual >> void __thiscall CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char >> const *,unsigned char const *,unsigned char *)const " >> (?processandxorbl...@enc@rijnd...@cryptopp@@UBEX >> pbe0...@z) >> aestest.obj : error LNK2001: unresolved external symbol "public: virtual >> void __thiscall CryptoPP::Rijndael::Base::UncheckedSetKey(unsigned char >> const *,unsigned int,class CryptoPP::NameValuePairs const &)" >> (?uncheckedset...@base@rijnd...@cryptopp@@ >> uaexpbeiabvnamevaluepa...@3@@Z) >> aestest.obj : error LNK2001: unresolved external symbol "class >> CryptoPP::NullNameValuePairs const CryptoPP::g_nullNameValuePairs" >> (?g_nullnamevaluepa...@cryptopp@@3vnullnamevaluepa...@1@B) >> aestest.obj : error LNK2001: unresolved external symbol "public: __thiscall >> CryptoPP::Algorithm::Algorithm(bool)" (??0algori...@cryptopp@@q...@_n@Z) >> aestest.obj : error LNK2001: unresolved external symbol "protected: void >> __thiscall CryptoPP::SimpleKeyingInterface::ThrowIfInvalidIV(unsigned char >> const *)" (?throwifinvali...@simplekeyinginterface@CryptoPP@@iaex...@z) >> aestest.obj : error LNK2001: unresolved external symbol "void __cdecl >> CryptoPP::CallNewHandler(void)" (?callnewhand...@cryptopp@@YAXXZ) >> aestest.obj : error LNK2001: unresolved external symbol "protected: unsigned >> int __thiscall CryptoPP::SimpleKeyingInterface::ThrowIfInvalidIVLength(int)" >> (?throwifinvalidivlen...@simplekeyinginterface@CryptoPP@@ia...@z) >> Debug/aestest.exe : fatal error LNK1120: 14 unresolved externals >> Error executing link.exe.) >> -- >> View this message in >> context:http://old.nabble.com/how-to-solve-these-%27error-LNK2001%3A%7E%7E%7E... >> Sent from the Crypto++ Users mailing list archive at Nabble.com. >> > > -- 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.
