I am attempting to use the latest version of Crypto++ (version 5.1) in Visual Studio.NET 2003 and the link stage emits many errors. The test sample (a console app) works just fine, fortunately.
I get many many unresolved external symbols such as this:
Linking...
cryptlibd.lib(iterhash.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
cryptlibd.lib(pssr.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED]) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" ([EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@1@@std@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@[EMAIL PROTECTED]@[EMAIL PROTECTED])
Now, for more details, I just created a new VS.NET MFC C++ dialog based project (including the socket libraries) and tried to add the following function:
#include "crypto++/osrng.h"
#include "crypto++/rsa.h"
void CCryptSetupDlg::OnBnClickedGenerateKey()
{
CryptoPP::AutoSeededRandomPool rng;
CryptoPP::InvertibleRSAFunction privKey;
privKey.Initialize(rng, 1024);
}
I did look at the FAQ and check the runtime libraries, the calling conventions and I checked to ensure that the VS.NET 2003 patch was applied. Anyone else use MFC with Crypto++ 5.1 ?
I have a feeling that I'm missing something very simple and easy...
Thanks in advance,
Brian Smith
