Hi inderpaul, I've encountered this with VC 6.0 when building a custom library rather than using the stock Crypto++ library. Comment out the two COMPILE_TIME_ASSERTs in RandomPool.
Jeff On 8/1/09, inderpaul <[email protected]> wrote: > > I am trying to compile a simple program source code included below > which taken from another post just recently. Working with Visual C++ > 6.0 on Windows 2000/XP. > > http://groups.google.com/group/cryptopp-users/browse_thread/thread/e26965549c4dac33 > > I added all of the cpp files associated with the required .h files but > still am getting a few linking errors posted below also. Any advice or > suggestions would be greatly appreciated. > > --------------------Source Code test1 -------------------- > > // test1.cpp : Defines the entry point for the console application. > // > > #include "stdafx.h" > #include <iostream> > #include <stdlib.h> > #include "cryptlib.h" > #include "default.h" > #include "hex.h" > #include "modes.h" > #include "aes.h" > > using namespace CryptoPP; > using namespace std; > > char *EncryptString(const char *instr, const char *passPhrase) ; > > // encode a string using passPhrase and encode it in hex > int main(int argc, char* argv[]) > { > //cout << crypt("firstpas", "as"); << "\n"; > cout << EncryptString("test string", "passwd") << "\n"; > return 0; > > } > > // returns the ciphertext, which should be deleted by caller > char *EncryptString(const char *instr, const char *passPhrase) > { > unsigned int len=strlen(instr); > char* outstr; > > > DefaultEncryptor encryptor(passPhrase, new HexEncoder); > //DefaultEncryptorWithMAC encryptor(passPhrase, new HexEncoder); > //encryptor.Put((byte *)instr, len); > //encryptor.MessageEnd(); > > //unsigned int outputLength = encryptor.MaxRetrievable(); > //outstr = new char[outputLength+1]; > //encryptor.Get((byte *)outstr, outputLength); > //outstr[outputLength] = 0; > return outstr; > } > > --------------------Configuration: test1 - Win32 > Debug-------------------- > Compiling... > randpool.cpp > d:\devs3\cryptography\cryptopp560\randpool.cpp(42) : error C2440: > 'initializing' : cannot convert from 'int' to 'struct > CryptoPP::CompileAssert<1>' > No constructor could take the source type, or constructor > overload resolution was ambiguous > d:\devs3\cryptography\cryptopp560\randpool.cpp(46) : error C2370: > 'cryptopp_assert_' : redefinition; different storage class > d:\devs3\cryptography\cryptopp560\randpool.cpp(42) : see > declaration of 'cryptopp_assert_' > d:\devs3\cryptography\cryptopp560\randpool.cpp(46) : error C2440: > 'initializing' : cannot convert from 'int' to 'struct > CryptoPP::CompileAssert<1>' > No constructor could take the source type, or constructor > overload resolution was ambiguous > Error executing cl.exe. > > test1.exe - 3 error(s), 0 warning(s) > ---------------------------------------------------------------------------------------------------- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. -~----------~----~----~----~------~----~------~--~---
