请问关于在MFC中使用Crypto++库的有关问题
请教关于在MFC中使用Crypto++库的问题
就是在VS2010中建立了一个MFC基于对话框的项目 ,使用了Crypto的 lib 在调试的过程中出现 ERROR LINK 2005
1>libcmt.lib(typinfo.obj) : error LNK2005: "public: bool __thiscall type_info::operator==(class type_info const &)const " (??8type_info@@QBE_NABV0@@Z) 已经在 msvcrt.lib(MSVCR100.dll) 中定义
1>libcmt.lib(typinfo.obj) : error LNK2005: "public: bool __thiscall type_info::operator!=(class type_info const &)const " (??9type_info@@QBE_NABV0@@Z) 已经在 msvcrt.lib(MSVCR100.dll) 中定......
头文件是如下
// RSAKeyGeneratorDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "RSAKeyGenerator.h"
#include "RSAKeyGeneratorDlg.h"
#include "randpool.h"
#include "rsa.h"
#include "hex.h"
#include "files.h"
#include <iostream>
using namespace std;
#include <string>
using namespace CryptoPP;
#pragma comment(lib, "cryptlib.lib")
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
后改成使用MTd模式 ,此时出现>
f:\visual studio 2010\vc\atlmfc\include\afxver_.h(81): fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
请教一下如果在MFC中使用Crypto++的一些环境设置等等需要注意的问题~
万分感谢~!!
------解决思路----------------------
这个问题我也遇到了,我在这里分享一下解决方法。从Crypto++网站下载源代码进行编译时,记得将里面四个项目的属性->C/C++->代码生成->运行库改为/MDd(DEBUG)或者/MD(RELEASE)。这样子编译出来的lib文件就可以解决您说的那种情况。
就是在VS2010中建立了一个MFC基于对话框的项目 ,使用了Crypto的 lib 在调试的过程中出现 ERROR LINK 2005
1>libcmt.lib(typinfo.obj) : error LNK2005: "public: bool __thiscall type_info::operator==(class type_info const &)const " (??8type_info@@QBE_NABV0@@Z) 已经在 msvcrt.lib(MSVCR100.dll) 中定义
1>libcmt.lib(typinfo.obj) : error LNK2005: "public: bool __thiscall type_info::operator!=(class type_info const &)const " (??9type_info@@QBE_NABV0@@Z) 已经在 msvcrt.lib(MSVCR100.dll) 中定......
头文件是如下
// RSAKeyGeneratorDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "RSAKeyGenerator.h"
#include "RSAKeyGeneratorDlg.h"
#include "randpool.h"
#include "rsa.h"
#include "hex.h"
#include "files.h"
#include <iostream>
using namespace std;
#include <string>
using namespace CryptoPP;
#pragma comment(lib, "cryptlib.lib")
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
后改成使用MTd模式 ,此时出现>
f:\visual studio 2010\vc\atlmfc\include\afxver_.h(81): fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
请教一下如果在MFC中使用Crypto++的一些环境设置等等需要注意的问题~
万分感谢~!!
------解决思路----------------------
这个问题我也遇到了,我在这里分享一下解决方法。从Crypto++网站下载源代码进行编译时,记得将里面四个项目的属性->C/C++->代码生成->运行库改为/MDd(DEBUG)或者/MD(RELEASE)。这样子编译出来的lib文件就可以解决您说的那种情况。