如何解决ase库的algparam.h(322): error C2061错误

在使用ase库的时候我遇到了一个编译错误,错误如下:

>e:\work\driverexam\include\aes\algparam.h(322): error C2061: 语法错误: 标识符“buffer”
1>          e:\work\driverexam\include\aes\algparam.h(321): 编译类 模板 成员函数“void CryptoPP::AlgorithmParametersTemplate<T>::MoveInto(void *) const”时
1>          with
1>          [
1>              T=bool
1>          ]
1>          e:\work\driverexam\include\aes\algparam.h(329): 参见对正在编译的类 模板 实例化“CryptoPP::AlgorithmParametersTemplate<T>”的引用
1>          with
1>          [
1>              T=bool
1>          ]
1>
1>生成失败。

在谷歌上查询发现是调试器在调试的时候使用了new关键字参考网址:http://stackoverflow.com/questions/15203562/crypto-giving-a-compiler-error-in-algparam-h

解决方法:在包含头文件的时候添加如下的宏就可以了。

#pragma push_macro("new")
#undef new
#include "AESCryptor.h"
#pragma pop_macro("new")

#include <string>
using namespace std;
void CaseLibTestDlg::OnBnClickedButton1()
{
	// TODO: 在此添加控件通知处理程序代码
	AESCryptor tt;
	string plain ="hello";
	string en = tt.Encrypt(plain);
	string p = tt.Decrypt(en);
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值