“Configuration Properties”→“C/C++” →“Code Generation”,右边的“Runtime Library”设置为“Multi-threaded Debug (/MTd)”(Release模式下对应着“Multi-threaded (/MT)”)
设置后:
fatal error C1189: #error :  Please use the /MD switch for _AFXDLL builds
如果设置成MD
则出现如下错误:
1>IWRParse_Client.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const *,unsigned int,class CryptoPP::NameValuePairs const &)" (?SetKey@SimpleKeyingInterface@CryptoPP@@UAEXPBEIABVNameValuePairs@2@@Z)
1>IWRParse_Client.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall CryptoPP::SimpleKeyingInterface::GetNextIV(class CryptoPP::RandomNumberGenerator &,unsigned char *)" (?GetNextIV@SimpleKeyingInterface@CryptoPP@@UAEXAAVRandomNumberGenerator@2@PAE@Z)
1>IWRParse_Client.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall CryptoPP::Rijndael::Base::UncheckedSetKey(unsigned char const *,unsigned int,class CryptoPP::NameValuePairs const &)" (?UncheckedSetKey@Base@Rijndael@CryptoPP@@UAEXPBEIABVNameValuePairs@3@@Z)
1>IWRParse_Client.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const *,unsigned char const *,unsigned char *)const " (?ProcessAndXorBlock@Enc@Rijndael@CryptoPP@@UBEXPBE0PAE@Z)
1>IWRParse_Client.obj : error LNK2001: 无法解析的外部符号 "public: virtual unsigned int __thiscall CryptoPP::BlockTransformation::OptimalDataAlignment(void)const " (?OptimalDataAlignment@BlockTransformation@CryptoPP@@UBEIXZ)
1>IWRParse_Client.obj : error LNK2001: 无法解析的外部符号 "public: virtual unsigned int __thiscall CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const *,unsigned char const *,unsigned char *,unsigned int,unsigned int)const " (?AdvancedProcessBlocks@Enc@Rijndael@CryptoPP@@UBEIPBE0PAEII@Z)
1>IWRParse_Client.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall CryptoPP::Algorithm::Algorithm(bool)" (??0Algorithm@CryptoPP@@QAE@_N@Z),该符号在函数 "public: __thiscall CryptoPP::BlockTransformation::BlockTransformation(void)" (??0BlockTransformation@CryptoPP@@QAE@XZ) 中被引用
1>E:\tscn\IWR_Client\Debug\IWR_Client.exe : fatal error LNK1120: 7 个无法解析的外部命令

解决方案 »

  1.   

    (1)“Configuration Properties”→“C/C++” →“General”,右边的“Additional Include Directories”设置为上面建好的Crypto++ SDK的Include文件夹,“C:\Program Files\CyptoPP\include”;(2) “Configuration Properties”→“Linker” →“General”,右边的“Additional Library Directories”设置为上面建好的Crypto++ SDK的Lib\Debug文件夹,“C:\Program Files\CyptoPP\lib\debug”(Release模式下对应着Release文件夹);这两步我都已经做了
      

  2.   

    楼主问题解决了吗?
    我也遇到同样的问题,如果生成控制台程序可以设“Multi-threaded Debug (/MTd)”,但改成MFC后就不行了。
      

  3.   

    知道问题所在了!
    MFC编译环境设为“多线程(/MT)”后不能编译,但我们可以在生成“cryptlib.lib”库文件时把编译环境设为与工程一致就行了,如“多线程 DLL (/MD)”。