When I compile on VS 2008 in deubg mode everything works fine. When I compile the same thing in release mode not everything works. As far as I can tell the include directories are the same and there are no additional preprocessor symbols.
Any help?
1>zlib.cpp 1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(419) : error C2664: 'CryptoPP::AllocatorWithCleanup::AllocatorWithCleanup(const CryptoPP::AllocatorWithCleanup &)' : cannot convert parameter 1 from 'CryptoPP::AllocatorWithCleanup' to 'const CryptoPP::AllocatorWithCleanup &' 1> with 1> [ 1>
T=std::_Aux_cont 1> ] 1>
and 1> [ 1>
T=CryptoPP::HuffmanDecoder::CodeInfo 1> ] 1> and 1> [ 1> T=std::_Aux_cont 1>
] 1> Reason: cannot convert from 'CryptoPP::AllocatorWithCleanup' to 'const CryptoPP::AllocatorWithCleanup' 1> with 1> [ 1>
T=CryptoPP::HuffmanDecoder::CodeInfo 1> ] 1> and 1> [ 1> T=std::_Aux_cont 1>
] 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(417) : while compiling class template member function 'std::_Container_base_aux_alloc_real<_Alloc>::_Container_base_aux_alloc_real(_Alloc)' 1> with 1> [ 1>
_Alloc=CryptoPP::AllocatorWithCleanup 1> ] 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\vector(421) : see reference to class template instantiation 'std::_Container_base_aux_alloc_real<_Alloc>' being compiled 1> with 1>
[ 1>
_Alloc=CryptoPP::AllocatorWithCleanup 1> ] 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\vector(439) : see reference to class template instantiation 'std::_Vector_val<_Ty,_Alloc>' being compiled 1> with 1> [ 1> _Ty=CryptoPP::HuffmanDecoder::CodeInfo, 1>
_Alloc=CryptoPP::AllocatorWithCleanup 1> ] 1>
C:\myproject\sshlib\zinflate.h(79) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled 1> with 1>
[ 1>
_Ty=CryptoPP::HuffmanDecoder::CodeInfo, 1>
_Ax=CryptoPP::AllocatorWithCleanup 1> ] 1>zinflate.cpp
The line of code it eventually points to is:
std::vector<CodeInfo, AllocatorWithCleanup<CodeInfo> > m_codeToValue;
Edit: More info:
I get this error exactly when my preprocessor contains NDEBUG instead of _DEBUG. If I change my release config to have _DEBUG isntead it compiles. Why?
_DEBUGbasically switches the build to debug mode. The custom allocator strategy of the Microsoft STL is different in debug mode, and is not affected by the bug. See the Nabble link in my answer below. - Frédéric Hamidi