On Tue, 20 Apr 2004 10:26:19 -0400
"Walton, Jeffrey" <[EMAIL PROTECTED]> wrote:
> I can't speak of managed code, but I have read about some issues with the
> compiler. Google may prove useful.
> 
> I've also found if I stuff things in afx, I'll get the error every now and
> again (being lazy and using it as a common header).

In the stdafx.h of my sample code, it only contains tchar.h, and nothing else
(in default it contains iostream, but I removed it), so afx thing has nothing
with it.

I could compile & link the sample code without /clr, so this is
Managed C++ specific problem in Crypto++. I haven't built the Crypto++ library,
but rather added necessary source files of Crypto++ into the samle project.

In my understanding of MC++, if you don't touch Managed types, you can
use template and things without a problem. Is it correct? I could use other
template-intensive Unmanaged C++ library with /clr.

Ken

> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> > Sent: Monday, April 19, 2004 9:59 PM
> > To: [EMAIL PROTECTED]
> > Subject: CryptoPP and Managed C++
> >
> >
> > Hello everyone and Wei,
> >
> > I compiled the following code under VC++ 7.1 with /clr switch
> > to make it recognized as Managed C++ code. My Crypto++
> > version is the latest off CVS c5 branch.
> >
> > -----------------------------------------------------------
> > #include "stdafx.h"
> >
> > #using <mscorlib.dll>
> >
> > using namespace System;
> >
> > #include "osrng.h"
> > #include "des.h"
> >
> > using namespace CryptoPP;
> >
> > int _tmain()
> > {
> >     AutoSeededX917RNG<DES_EDE3> rng;
> >
> >     return 0;
> > }
> >
> > ------------------------------------------------------------
> >
> > While compilation is OK except for a warning at integer.cpp(1567)
> > "warning C4561: '__fastcall' incompatible with the '/clr'
> > option", I had linker errors in CryptoPP::CheckedSetKey:
> >
> > test error LNK2005: "void __cdecl
> > CryptoPP::CheckedSetKey<class
> > CryptoPP::BlockCipherFinal<0,class CryptoPP::DES::Base>
> > >(class CryptoPP::BlockCipherFinal<0,class
> > CryptoPP::DES::Base> *,enum CryptoPP::CipherDir,unsigned char
> > const *,unsigned int,class CryptoPP::NameValuePairs const &)"
> > ([EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@
> > @CryptoPP@@@CryptoPP@@[EMAIL PROTECTED]@[EMAIL PROTECTED]
> > [EMAIL PROTECTED]@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@0@@Z)
> > already defined in test.obj test error LNK2005: "void __cdecl
> > CryptoPP::CheckedSetKey<class
> > CryptoPP::BlockCipherFinal<0,class CryptoPP::DES::Base>
> > >(class CryptoPP::BlockCipherFinal<0,class
> > CryptoPP::DES::Base> *,enum CryptoPP::CipherDir,unsigned char
> > const *,unsigned int,class CryptoPP::NameValuePairs const &)"
> > ([EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@
> > @CryptoPP@@@CryptoPP@@[EMAIL PROTECTED]@[EMAIL PROTECTED]
> > [EMAIL PROTECTED]@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@0@@Z)
> > already defined in test.obj test error LNK2005: "void __cdecl
> > CryptoPP::CheckedSetKey<class
> > CryptoPP::BlockCipherFinal<0,class CryptoPP::DES::Base>
> > >(class CryptoPP::BlockCipherFinal<0,class
> > CryptoPP::DES::Base> *,enum CryptoPP::CipherDir,unsigned char
> > const *,unsigned int,class CryptoPP::NameValuePairs const &)"
> > ([EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@
> > @CryptoPP@@@CryptoPP@@[EMAIL PROTECTED]@[EMAIL PROTECTED]
> > [EMAIL PROTECTED]@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@0@@Z)
> > already defined in test.obj test error LNK2005: "void __cdecl
> > CryptoPP::CheckedSetKey<class
> > CryptoPP::BlockCipherFinal<0,class CryptoPP::DES::Base>
> > >(class CryptoPP::BlockCipherFinal<0,class
> > CryptoPP::DES::Base> *,enum CryptoPP::CipherDir,unsigned char
> > const *,unsigned int,class CryptoPP::NameValuePairs const &)"
> > ([EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@
> > @CryptoPP@@@CryptoPP@@[EMAIL PROTECTED]@[EMAIL PROTECTED]
> > [EMAIL PROTECTED]@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@0@@Z)
> > already defined in test.obj test error LNK2005: "void __cdecl
> > CryptoPP::CheckedSetKey<class
> > CryptoPP::BlockCipherFinal<0,class CryptoPP::DES::Base>
> > >(class CryptoPP::BlockCipherFinal<0,class
> > CryptoPP::DES::Base> *,enum CryptoPP::CipherDir,unsigned char
> > const *,unsigned int,class CryptoPP::NameValuePairs const &)"
> > ([EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@
> > @CryptoPP@@@CryptoPP@@[EMAIL PROTECTED]@[EMAIL PROTECTED]
> > [EMAIL PROTECTED]@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@0@@Z)
> > already defined in test.obj
> >
> > Is there any future plan to add workaround for Managed C++ or
> > someone who already tried it?
> >
> >
> >
> > Ken
> >
> >


Reply via email to