创建RSA_PrivateKey时对"std::thread::_State::~_State()"的未定义引用

undefined reference to `std::thread::_State::~_State()' while creating RSA_PrivateKey

本文关键字:State 引用 未定义 thread PrivateKey 时对 std 创建 RSA      更新时间:2023-10-16

编译器抱怨不定义的std :: thread :: _ state :: _ state :: 〜_state((当我尝试在botan c 中创建rsa_privatekey对象。

#include <QCoreApplication>
#include <botan/rsa.h>
#include <botan/auto_rng.h>
#include <iostream>
using std::cout;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
std::unique_ptr<Botan::RandomNumberGenerator> rng(new Botan::AutoSeeded_RNG);
cout << rng->name();
// this line caused the error
 std::unique_ptr<Botan::RSA_PrivateKey> theKey(new Botan::RSA_PrivateKey(*rng.get(),1024));
return a.exec();
}

错误显示这样的:在Botan中创建RSA_PRIVATEKEKEN时出错

我真的不确定编译器为什么要抱怨。我需要帮助,谢谢。

我使用" .A"文件添加了Botan库作为静态库。我通过右键单击项目文件夹>添加库>外部库来做到这一点。我试图在调试中编译。

添加像这样的botan

OS:Windows 7

编译器:QT 5.11.2 Mingw 32-t

您应该创建一个Botan::RSA_PrivateKey的实例:

Botan::RSA_PrivateKey rsa(*rng.get(),1024);