Crypto ++ gives a compiler error in algparam.h

I have the following lines in a fairly large file:

#include <sha.h> #include <hex.h> 

What compiles this compiler error when compiling:

 1>d:\work\app\tools\cryptopp\algparam.h(322): error C2061: syntax error : identifier 'buffer' 1> d:\work\app\tools\cryptopp\algparam.h(321) : while compiling class template member function 'void CryptoPP::AlgorithmParametersTemplate<T>::MoveInto(void *) const' 1> with 1> [ 1> T=bool 1> ] 1> d:\work\app\tools\cryptopp\algparam.h(329) : see reference to class template instantiation 'CryptoPP::AlgorithmParametersTemplate<T>' being compiled 1> with 1> [ 1> T=bool 1> ] 

I am pretty sure that I am forgetting something, but I am not sure that. If I don't turn on hex.h, I have no problem and I get the SHA256 hash just fine, but when I turn on hex.h a tooltip appears.

Edit

In case someone wonders, from algparam.h Crypto ++ toolkit:

 void MoveInto(void *buffer) const //<=== line 320 { AlgorithmParametersTemplate<T>* p = new(buffer) AlgorithmParametersTemplate<T>(*this); } CRYPTOPP_DLL_TEMPLATE_CLASS AlgorithmParametersTemplate<bool>; // <== line 329 

Edit : remote unrelated code

+6
source share
2 answers

I fixed the problem by temporarily disabling new , which was defined as a macro for some additional debugging code.

 #pragma push_macro("new") #undef new /* #includes for Crypto++ go here */ #pragma pop_macro("new") 
+6
source

If you include Crypto ++ in an MFC-enabled Visual Studio project, this error may be caused by this line:

 #ifdef _DEBUG #define new DEBUG_NEW #endif 

Be sure to delete it or comment.

+1
source

All Articles