Title: Link error VS.2003 MFC app
Apologies to the group. I meant my last message to go directly to brian to begin a dialog off-list.
 
The most important consideration in using MFC with CryptoPP is to make sure that you make the library and the application/dll both with MFC turned on. I found when I tried to link the library into an mfc app I got errors...until I linked the lib with mfc. Same is true with debug and other flags...make sure the library and the app match exactly for compile and link options.
 
-Michael
-----Original Message-----
From: Brian Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 18, 2003 12:41 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Link error VS.2003 MFC app

Has anyone actually used the Crypto++ library in an MFC application?  Barring that, how about making a DLL?  My goal is to be able to use it (without great modification) in MFC applications and/or .NET applications.
 
Currently, I'm using RSAREF code hand translated from C to C#, which works.  However, I'd prefer to use the Crypto++ library with it's larger assortment of algorithms, more attractive license scheme, and more active development group.
 
I hope to at least get a reply this time.
 
Thanks in advance,
Brian
-----Original Message-----
From: Brian Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, August 29, 2003 13:34
To: '[EMAIL PROTECTED]'
Subject: Link error VS.2003 MFC app

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

Reply via email to