Crypto ++庫通過編譯cryptlib.lib
和cryptopp.lib
來支持後期綁定。這需要使用cryptopp.dll
。當試圖延遲加載這個dll /DELAYLOAD:cryptopp.dll
這會導致一個鏈接錯誤,它不能延遲加載,因爲所需的導入。延遲加載crypto ++ cryptopp.dll
作爲示例,請參見下面的代碼:
#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;
}
這會導致下面的鏈接錯誤:
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 *)" ([email protected]@@[email protected]@[email protected])". Link without /DELAYLOAD:cryptopp.dll
有沒有人已經成功地延遲加載cryptopp.dll
成功?