Hi Brian,

I've used the library in both MFC and COM dll's. However, I have not used it
with .NET - I haven't acquired a taste for the new IDE.

As for the link errors, verify you are using a multithread runtime (this is
what Wei uses). Also, I would recommend putting the Crypto++ stuff on path.

Are you using a third party STL? I have not been able to use Dinkumware's
STL in all cases with MFC apps. I had to rebuild the library with MS's stock
STL to get a MDI app to link.

Link errors can be tough under VC++.

Jeff


-----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]
Z)
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]
Z) 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]@std@@[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