The Crypto++ library supports late binding by compiling against cryptlib.lib
and cryptopp.lib
. This requires to use the cryptopp.dll
. When trying to delay-load this dll by /DELAYLOAD:cryptopp.dll
this causes a link error that it could not be delay loaded because of required imports.
As example see the following code:
#include <Crypto++/dll.h>
#include <crypto++/base64.h>
bool HexDecode(const std::string& strHex, std::string& strData)
{
try
{
CryptoPP::StringSource(strHex, true,
new CryptoPP::Base64Decoder(
new CryptoPP::StringSink(strData)));
}
catch(...)
{
return false;
}
return true;
}
This causes the following link error:
LINK : fatal error LNK1194: Delay loading "cryptopp.dll" not possible because of import of data symbol ""__declspec(dllimport) bool (__cdecl* CryptoPP::g_pAssignIntToInteger)(class type_info const &,void *,void const *)" (__imp_?g_pAssignIntToInteger@CryptoPP@@3P6A_NABVtype_info@@PAXPBX@ZA)". Link without /DELAYLOAD:cryptopp.dll
Did anyone already managed to delay load cryptopp.dll
successfully?