使用Crypto++报错
上代码
#include <iostream>
#include "CryptoPP\include\aes.h"
#include "CryptoPP\include\hex.h"
#include "CryptoPP\include\modes.h"
#include <fstream>
#include <sstream>
#include <winsock2.h>
#pragma comment(lib,"CryptlibD.lib")
using namespace std;
using namespace CryptoPP;
unsigned char iv[16];
string strEncTxt,strDecTxt;
string ReadFileIntoStringaaa(){//这是个读文件的函数,和它没关系
ifstream ifile("a.txt");
ostringstream buf;
char ch;
while ( buf && ifile.get(ch) )
buf.put(ch);
return buf.str();
}
int main(){
unsigned char key[]="abcdefghijklmnop";
int keysize = 16;
strEncTxt=ReadFileIntoStringaaa();
ECB_Mode<AES>::Decryption Decryptor1(key,keysize);
StringSource(strEncTxt,true,new StreamTransformationFilter(Decryptor1,new StringSink(strDecTxt)));
cout<<strDecTxt<<endl;
return 0;
}
[Error] ld returned 1 exit status,一直都是这个
而且我发现似乎我注释掉#pragma也是一样的
是我安装Crypto++的时候出问题了吗?我直接下载别人编译好的lib和include文件夹直接复制粘贴进MinGW64\include\CryptoPP这个目录里的。检查了几遍代码,没有其他的.c或者.cpp,也没拼成mian,也没正在运行的程序(连编译都没过),到底是哪出问题了?