title: How to easily apply Crypto++ hash functions?
body: <p>Can someone help me how can I easily use hash functions from Crypto++ library?
  I tried used these codes for SHA1 and MD5. I have many errors on line where is <code>StringSink</code>. The errors are like:</p>
  
  <pre><code>undefined reference to `CryptoPP::StringSinkTemplate::StringSinkTemplate(std::string&amp;)'
  </code></pre>
  
  <p>Thanks for help.</p>
  
  <pre><code> // SHA
  CryptoPP::SHA1 sha1;
  std::string source = "Hello";
  std::string hash = "";
  CryptoPP::StringSource(source, true, new CryptoPP::HashFilter(sha1, new CryptoPP::HexEncoder(new CryptoPP::StringSink(hash))));
  std::cout &lt;&lt; hash;
  
  // MD5
  CryptoPP::MD5 hash;
  byte digest[ CryptoPP::MD5::DIGESTSIZE ];
  std::string message = "abcdefghijklmnopqrstuvwxyz";
  
  hash.CalculateDigest( digest, (byte*) message.c_str(), message.length() );
  
  CryptoPP::HexEncoder encoder;
  std::string output;
  encoder.Attach( new CryptoPP::StringSink( output ) );
  encoder.Put( digest, sizeof(digest) );
  encoder.MessageEnd();
  
  std::cout &lt;&lt; output &lt;&lt; std::endl;
  </code></pre>