Adding a library to msc++

E3465662c70bd9bebf3f75223a7a5ce4
0
c0mputer_fr0d 101 Aug 10, 2012 at 09:32

I can’t seem to add cryptolib++ to my project I follow this tutorial to the T http://www.codeproject.com/Articles/16388/Compiling-and-Integrating-Crypto-into-the-Microsof

But it still doesn’t work I followed all that and included the lib like this

#include <sha.h>
#ifdef _DEBUG 
#  pragma comment ( lib, "cryptlibd" ) 
#else 
#  pragma comment ( lib, "cryptlib" ) 
#endif

Please Help!

5 Replies

Please log in or register to post a reply.

340bf64ac6abda6e40f7e860279823cb
0
_oisyn 101 Aug 10, 2012 at 10:18

How “doesn’t it work”? Please provide a clear description of any compiler or linker errors.

Have you tried adding .lib to the library names?

E3465662c70bd9bebf3f75223a7a5ce4
0
c0mputer_fr0d 101 Aug 10, 2012 at 10:52

sorry heres all the errors I get

[font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\newprojects\meine encrypter\meine encrypter\cryptlib.h(290): error C3641: 'CryptoPP::NameValuePairs::ThrowIfTypeMismatch' : invalid calling convention '__cdecl ' for function compiled with /clr:pure or /clr:safe[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(263): error C3861: '_BitScanForward': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(494): error C3861: '__stosb': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(504): error C3861: '__stosw': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(514): error C3861: '__stosd': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(699): error C3861: '_rotl16': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(705): error C3861: '_rotr16': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(711): error C3861: '_rotl16': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(717): error C3861: '_rotr16': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(722): error C3861: '_rotl16': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(733): error C3861: '_rotl8': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(739): error C3861: '_rotr8': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(745): error C3861: '_rotl8': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(751): error C3861: '_rotr8': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(756): error C3861: '_rotl8': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(761): error C3861: '_rotr8': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\misc.h(761): error C3861: '_rotr8': identifier not found[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\rijndael.h(15): error C3641: 'CryptoPP::Rijndael_Info::StaticAlgorithmName' : invalid calling convention '__cdecl ' for function compiled with /clr:pure or /clr:safe[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\sha.h(14): error C3641: 'CryptoPP::SHA1::StaticAlgorithmName' : invalid calling convention '__cdecl ' for function compiled with /clr:pure or /clr:safe[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\sha.h(28): error C3641: 'CryptoPP::SHA256::StaticAlgorithmName' : invalid calling convention '__cdecl ' for function compiled with /clr:pure or /clr:safe[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\sha.h(39): error C3641: 'CryptoPP::SHA224::Transform' : invalid calling convention '__cdecl ' for function compiled with /clr:pure or /clr:safe[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\sha.h(40): error C3641: 'CryptoPP::SHA224::StaticAlgorithmName' : invalid calling convention '__cdecl ' for function compiled with /clr:pure or /clr:safe[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\sha.h(49): error C3641: 'CryptoPP::SHA512::StaticAlgorithmName' : invalid calling convention '__cdecl ' for function compiled with /clr:pure or /clr:safe[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\sha.h(57): error C3641: 'CryptoPP::SHA384::Transform' : invalid calling convention '__cdecl ' for function compiled with /clr:pure or /clr:safe[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\cryptolib++\sha.h(58): error C3641: 'CryptoPP::SHA384::StaticAlgorithmName' : invalid calling convention '__cdecl ' for function compiled with /clr:pure or /clr:safe[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>c:\users\jack\desktop\newprojects\meine encrypter\meine encrypter\Hashes.h(455): error C2664: 'CryptoPP::HashTransformation::CalculateDigest' : cannot convert parameter 1 from 'System::String ^' to 'byte *'[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>         No user-defined-conversion operator available, or[/size][/font][font=Arial, Helvetica, sans-serif][size=3]

1>         Cannot convert a managed type to an unmanaged type

[/size][/font]
Please help I’m just about to quit because I just keep hitting one brick wall after another.

Thank you for such a quick response, I tried adding .lib to the ends of those pragmas like cryptlib.lib but no luck.

E3465662c70bd9bebf3f75223a7a5ce4
0
c0mputer_fr0d 101 Aug 10, 2012 at 13:09

what does -MD mean is that have something to do with managed code?

E3465662c70bd9bebf3f75223a7a5ce4
0
c0mputer_fr0d 101 Aug 11, 2012 at 07:52

fixed it by setting it to common runtime language.Thanks all.