title: Crypto++ errors on creating cipher text
body: <p>I am pretty new to C++ and I need to use Crypto++. I have been looking for examples that explain how to use it. I found this <a href="https://stackoverflow.com/questions/12306956/example-of-aes-using-crypto">Example of AES using Crypto++</a> . And I think this is great... the only thing is when I try to build it, I get a bunch of errors!</p>
  
  <p>First off, I had to change the include path for the header files. I am not sure why, but when I didn't add the "crypto++" in front of the path, it could not find the header files. Another post suggested to use it and it seems to make the errors go away.</p>
  
  <p>In case you want to see the code I am trying to build, it is here:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;iomanip&gt;
  
  #include "crypto++/modes.h"
  #include "crypto++/aes.h"
  #include "crypto++/filters.h"
  using namespace std;
  int main(int argc, char* argv[]) {
  
      //
      // Key and IV setup
      //AES encryption uses a secret key of a variable length (128-bit, 196-bit or 256-   
      //bit). This key is secretly exchanged between two parties before communication   
      //begins. DEFAULT_KEYLENGTH= 16 bytes
      byte key[ CryptoPP::AES::DEFAULT_KEYLENGTH ], iv[ CryptoPP::AES::BLOCKSIZE ];
      memset( key, 0x00, CryptoPP::AES::DEFAULT_KEYLENGTH );
      memset( iv, 0x00, CryptoPP::AES::BLOCKSIZE );
  
      //
      // String and Sink setup
      //
      string plaintext = "Now is the time for all good men to come to the aide...";
      string ciphertext;
      string decryptedtext;
  
      //
      // Dump Plain Text
      //
      cout &lt;&lt; "Plain Text (" &lt;&lt; plaintext.size() &lt;&lt; " bytes)" &lt;&lt; endl;
      cout &lt;&lt; plaintext;
      cout &lt;&lt; endl &lt;&lt; endl;
  
      // //
      // // Create Cipher Text
      // //
      CryptoPP::AES::Encryption aesEncryption(key, CryptoPP::AES::DEFAULT_KEYLENGTH);
      CryptoPP::CBC_Mode_ExternalCipher::Encryption cbcEncryption( aesEncryption, iv );
  
      CryptoPP::StreamTransformationFilter stfEncryptor(cbcEncryption, new CryptoPP::StringSink( ciphertext ) );
      stfEncryptor.Put( reinterpret_cast&lt;const unsigned char*&gt;( plaintext.c_str() ), plaintext.length() + 1 );
      stfEncryptor.MessageEnd();
  
      //
      // Dump Cipher Text
      //
      cout &lt;&lt; "Cipher Text (" &lt;&lt; ciphertext.size() &lt;&lt; " bytes)" &lt;&lt; endl;
  
      for( int i = 0; i &lt; ciphertext.size(); i++ ) {
  
          cout &lt;&lt; "0x" &lt;&lt; hex &lt;&lt; (0xFF &amp; static_cast&lt;byte&gt;(ciphertext[i])) &lt;&lt; " ";
      }
  
      cout &lt;&lt; endl &lt;&lt; endl;
  
      //
      // Decrypt
      //
      CryptoPP::AES::Decryption aesDecryption(key, CryptoPP::AES::DEFAULT_KEYLENGTH);
      CryptoPP::CBC_Mode_ExternalCipher::Decryption cbcDecryption( aesDecryption, iv );
  
      CryptoPP::StreamTransformationFilter stfDecryptor(cbcDecryption, new CryptoPP::StringSink( decryptedtext ) );
      stfDecryptor.Put( reinterpret_cast&lt;const unsigned char*&gt;( ciphertext.c_str() ), ciphertext.size() );
      stfDecryptor.MessageEnd();
  
      //
      // Dump Decrypted Text
      //
      cout &lt;&lt; "Decrypted Text: " &lt;&lt; endl;
      cout &lt;&lt; decryptedtext;
      cout &lt;&lt; endl &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>These are the errors I get</p>
  
  <pre><code>/tmp/cczoSf1S.o: In function `CryptoPP::SimpleKeyingInterface::~SimpleKeyingInterface()':
  AES.cpp:(.text._ZN8CryptoPP21SimpleKeyingInterfaceD2Ev[_ZN8CryptoPP21SimpleKeyingInterfaceD5Ev]+0xb): undefined reference to `vtable for CryptoPP::SimpleKeyingInterface'
  /tmp/cczoSf1S.o: In function `CryptoPP::SimpleKeyingInterface::SimpleKeyingInterface()':
  AES.cpp:(.text._ZN8CryptoPP21SimpleKeyingInterfaceC2Ev[_ZN8CryptoPP21SimpleKeyingInterfaceC5Ev]+0x8): undefined reference to `vtable for CryptoPP::SimpleKeyingInterface'
  /tmp/cczoSf1S.o: In function `CryptoPP::BlockTransformation::~BlockTransformation()':
  AES.cpp:(.text._ZN8CryptoPP19BlockTransformationD2Ev[_ZN8CryptoPP19BlockTransformationD5Ev]+0xb): undefined reference to `vtable for CryptoPP::BlockTransformation'
  /tmp/cczoSf1S.o: In function `CryptoPP::Rijndael::Base::~Base()':
  AES.cpp:(.text._ZN8CryptoPP8Rijndael4BaseD2Ev[_ZN8CryptoPP8Rijndael4BaseD5Ev]+0xc): undefined reference to `vtable for CryptoPP::Rijndael::Base'
  AES.cpp:(.text._ZN8CryptoPP8Rijndael4BaseD2Ev[_ZN8CryptoPP8Rijndael4BaseD5Ev]+0x16): undefined reference to `vtable for CryptoPP::Rijndael::Base'
  /tmp/cczoSf1S.o: In function `CryptoPP::Rijndael::Enc::~Enc()':
  AES.cpp:(.text._ZN8CryptoPP8Rijndael3EncD2Ev[_ZN8CryptoPP8Rijndael3EncD5Ev]+0xb): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
  AES.cpp:(.text._ZN8CryptoPP8Rijndael3EncD2Ev[_ZN8CryptoPP8Rijndael3EncD5Ev]+0x15): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
  /tmp/cczoSf1S.o: In function `CryptoPP::BlockTransformation::BlockTransformation()':
  AES.cpp:(.text._ZN8CryptoPP19BlockTransformationC2Ev[_ZN8CryptoPP19BlockTransformationC5Ev]+0x15): undefined reference to `CryptoPP::Algorithm::Algorithm(bool)'
  AES.cpp:(.text._ZN8CryptoPP19BlockTransformationC2Ev[_ZN8CryptoPP19BlockTransformationC5Ev]+0x1e): undefined reference to `vtable for CryptoPP::BlockTransformation'
  /tmp/cczoSf1S.o: In function `CryptoPP::Rijndael::Base::Base()':
  AES.cpp:(.text._ZN8CryptoPP8Rijndael4BaseC2Ev[_ZN8CryptoPP8Rijndael4BaseC5Ev]+0x17): undefined reference to `vtable for CryptoPP::Rijndael::Base'
  AES.cpp:(.text._ZN8CryptoPP8Rijndael4BaseC2Ev[_ZN8CryptoPP8Rijndael4BaseC5Ev]+0x21): undefined reference to `vtable for CryptoPP::Rijndael::Base'
  /tmp/cczoSf1S.o: In function `CryptoPP::Rijndael::Enc::Enc()':
  AES.cpp:(.text._ZN8CryptoPP8Rijndael3EncC2Ev[_ZN8CryptoPP8Rijndael3EncC5Ev]+0x16): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
  AES.cpp:(.text._ZN8CryptoPP8Rijndael3EncC2Ev[_ZN8CryptoPP8Rijndael3EncC5Ev]+0x20): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
  /tmp/cczoSf1S.o: In function `CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;::BlockCipherFinal(unsigned char const*, unsigned int)':
  AES.cpp:(.text._ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEC2EPKhj[_ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEC5EPKhj]+0x27): undefined reference to `CryptoPP::g_nullNameValuePairs'
  AES.cpp:(.text._ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEC2EPKhj[_ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEC5EPKhj]+0x44): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&amp;)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[vtable for CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;]+0x24): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&amp;)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[vtable for CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;]+0x3c): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&amp;, unsigned char*)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[vtable for CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;]+0x44): undefined reference to `CryptoPP::Rijndael::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&amp;)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[vtable for CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;]+0x50): undefined reference to `CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[vtable for CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;]+0x54): undefined reference to `CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned int, unsigned int) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[vtable for CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;]+0x78): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[vtable for CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;]+0x80): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[vtable for CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;]+0x90): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned int, unsigned int) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[vtable for CryptoPP::ClonableImpl&lt;CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;, CryptoPP::Rijndael::Enc&gt;]+0x24): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&amp;)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[vtable for CryptoPP::ClonableImpl&lt;CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;, CryptoPP::Rijndael::Enc&gt;]+0x3c): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&amp;, unsigned char*)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[vtable for CryptoPP::ClonableImpl&lt;CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;, CryptoPP::Rijndael::Enc&gt;]+0x44): undefined reference to `CryptoPP::Rijndael::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&amp;)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[vtable for CryptoPP::ClonableImpl&lt;CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;, CryptoPP::Rijndael::Enc&gt;]+0x50): undefined reference to `CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[vtable for CryptoPP::ClonableImpl&lt;CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;, CryptoPP::Rijndael::Enc&gt;]+0x54): undefined reference to `CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned int, unsigned int) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[vtable for CryptoPP::ClonableImpl&lt;CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;, CryptoPP::Rijndael::Enc&gt;]+0x74): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[vtable for CryptoPP::ClonableImpl&lt;CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;, CryptoPP::Rijndael::Enc&gt;]+0x7c): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[vtable for CryptoPP::ClonableImpl&lt;CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;, CryptoPP::Rijndael::Enc&gt;]+0x8c): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned int, unsigned int) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP15BlockCipherImplINS_13Rijndael_InfoENS_11BlockCipherEEE[vtable for CryptoPP::BlockCipherImpl&lt;CryptoPP::Rijndael_Info, CryptoPP::BlockCipher&gt;]+0x24): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&amp;)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP15BlockCipherImplINS_13Rijndael_InfoENS_11BlockCipherEEE[vtable for CryptoPP::BlockCipherImpl&lt;CryptoPP::Rijndael_Info, CryptoPP::BlockCipher&gt;]+0x3c): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&amp;, unsigned char*)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP15BlockCipherImplINS_13Rijndael_InfoENS_11BlockCipherEEE[vtable for CryptoPP::BlockCipherImpl&lt;CryptoPP::Rijndael_Info, CryptoPP::BlockCipher&gt;]+0x70): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP15BlockCipherImplINS_13Rijndael_InfoENS_11BlockCipherEEE[vtable for CryptoPP::BlockCipherImpl&lt;CryptoPP::Rijndael_Info, CryptoPP::BlockCipher&gt;]+0x80): undefined reference to `CryptoPP::BlockTransformation::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned int, unsigned int) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP13AlgorithmImplINS_25SimpleKeyingInterfaceImplINS_8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEES5_EES6_EE[vtable for CryptoPP::AlgorithmImpl&lt;CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt;, CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt; &gt;]+0x24): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&amp;)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP13AlgorithmImplINS_25SimpleKeyingInterfaceImplINS_8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEES5_EES6_EE[vtable for CryptoPP::AlgorithmImpl&lt;CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt;, CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt; &gt;]+0x3c): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&amp;, unsigned char*)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP13AlgorithmImplINS_25SimpleKeyingInterfaceImplINS_8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEES5_EES6_EE[vtable for CryptoPP::AlgorithmImpl&lt;CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt;, CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt; &gt;]+0x6c): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP13AlgorithmImplINS_25SimpleKeyingInterfaceImplINS_8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEES5_EES6_EE[vtable for CryptoPP::AlgorithmImpl&lt;CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt;, CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt; &gt;]+0x7c): undefined reference to `CryptoPP::BlockTransformation::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned int, unsigned int) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP25SimpleKeyingInterfaceImplINS_8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEES4_EE[vtable for CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt;]+0x24): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&amp;)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP25SimpleKeyingInterfaceImplINS_8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEES4_EE[vtable for CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt;]+0x3c): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&amp;, unsigned char*)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP25SimpleKeyingInterfaceImplINS_8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEES4_EE[vtable for CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt;]+0x68): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP25SimpleKeyingInterfaceImplINS_8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEES4_EE[vtable for CryptoPP::SimpleKeyingInterfaceImpl&lt;CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;, CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt; &gt;]+0x78): undefined reference to `CryptoPP::BlockTransformation::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned int, unsigned int) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEE[vtable for CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;]+0x24): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&amp;)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEE[vtable for CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;]+0x3c): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&amp;, unsigned char*)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEE[vtable for CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;]+0x68): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP8TwoBasesINS_11BlockCipherENS_13Rijndael_InfoEEE[vtable for CryptoPP::TwoBases&lt;CryptoPP::BlockCipher, CryptoPP::Rijndael_Info&gt;]+0x78): undefined reference to `CryptoPP::BlockTransformation::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned int, unsigned int) const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP11BlockCipherE[vtable for CryptoPP::BlockCipher]+0x24): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&amp;)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP11BlockCipherE[vtable for CryptoPP::BlockCipher]+0x3c): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&amp;, unsigned char*)'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP11BlockCipherE[vtable for CryptoPP::BlockCipher]+0x68): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
  /tmp/cczoSf1S.o:(.rodata._ZTVN8CryptoPP11BlockCipherE[vtable for CryptoPP::BlockCipher]+0x78): undefined reference to `CryptoPP::BlockTransformation::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned int, unsigned int) const'
  /tmp/cczoSf1S.o:(.rodata._ZTIN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[typeinfo for CryptoPP::ClonableImpl&lt;CryptoPP::BlockCipherFinal&lt;(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc&gt;, CryptoPP::Rijndael::Enc&gt;]+0x8): undefined reference to `typeinfo for CryptoPP::Rijndael::Enc'
  /tmp/cczoSf1S.o:(.rodata._ZTIN8CryptoPP11BlockCipherE[typeinfo for CryptoPP::BlockCipher]+0x10): undefined reference to `typeinfo for CryptoPP::SimpleKeyingInterface'
  /tmp/cczoSf1S.o:(.rodata._ZTIN8CryptoPP11BlockCipherE[typeinfo for CryptoPP::BlockCipher]+0x18): undefined reference to `typeinfo for CryptoPP::BlockTransformation'
  /tmp/cczoSf1S.o: In function `CryptoPP::SimpleKeyingInterface::SimpleKeyingInterface(CryptoPP::SimpleKeyingInterface const&amp;)':
  AES.cpp:(.text._ZN8CryptoPP21SimpleKeyingInterfaceC2ERKS0_[_ZN8CryptoPP21SimpleKeyingInterfaceC5ERKS0_]+0x8): undefined reference to `vtable for CryptoPP::SimpleKeyingInterface'
  /tmp/cczoSf1S.o: In function `CryptoPP::BlockTransformation::BlockTransformation(CryptoPP::BlockTransformation const&amp;)':
  AES.cpp:(.text._ZN8CryptoPP19BlockTransformationC2ERKS0_[_ZN8CryptoPP19BlockTransformationC5ERKS0_]+0x1d): undefined reference to `vtable for CryptoPP::BlockTransformation'
  /tmp/cczoSf1S.o: In function `CryptoPP::Rijndael::Base::Base(CryptoPP::Rijndael::Base const&amp;)':
  AES.cpp:(.text._ZN8CryptoPP8Rijndael4BaseC2ERKS1_[_ZN8CryptoPP8Rijndael4BaseC5ERKS1_]+0x1e): undefined reference to `vtable for CryptoPP::Rijndael::Base'
  AES.cpp:(.text._ZN8CryptoPP8Rijndael4BaseC2ERKS1_[_ZN8CryptoPP8Rijndael4BaseC5ERKS1_]+0x28): undefined reference to `vtable for CryptoPP::Rijndael::Base'
  /tmp/cczoSf1S.o: In function `CryptoPP::Rijndael::Enc::Enc(CryptoPP::Rijndael::Enc const&amp;)':
  AES.cpp:(.text._ZN8CryptoPP8Rijndael3EncC2ERKS1_[_ZN8CryptoPP8Rijndael3EncC5ERKS1_]+0x1d): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
  AES.cpp:(.text._ZN8CryptoPP8Rijndael3EncC2ERKS1_[_ZN8CryptoPP8Rijndael3EncC5ERKS1_]+0x27): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
  collect2: ld returned 1 exit status
  [Finished in 0.7s with exit code 1]
  [shell_cmd: g++ "/home/jack/Desktop/Crytpo C++/AES.cpp" -o "/home/jack/Desktop/Crytpo C++/AES"]
  [dir: /home/jack/Desktop/Crytpo C++]
  [path: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games]
  </code></pre>
  
  <p>I tried putting in the lines 1 at a time, then building and it seems to start getting errors at creating the cipher text.</p>