创建RSA_PrivateKey时对"std::thread::_State::~_State()"的未定义引用
undefined reference to `std::thread::_State::~_State()' while creating RSA_PrivateKey
编译器抱怨不定义的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);
相关文章:
- 将对象数组的引用传递给函数
- 什么时候在C++中返回常量引用是个好主意
- 我想将一个对T类型的非常量左值引用绑定到一个T类型的临时值
- 何时在引用或唯一指针上使用移动语义
- 如何在c++中使用引用实现类似python的行为
- 编译C++时未定义的引用
- Ctypes wstring通过引用传递
- c++r值引用应用于函数指针
- 理解c++中的引用
- C++取消引用指针.为什么会发生变化
- 如何修复此错误:未定义对"距离(浮点数,浮点数,浮点数,浮点数,浮点数)"的引用
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- C++Boost Asio Pool线程,带有lambda函数和传递引用变量
- 强制转换为引用类型
- 引用一个已擦除类型(void*)的指针
- 向量元素的引用地址与它所指向的向量元素的地址不同.为什么
- 具有默认值的引用获取函数
- 如何使用基类指针引用派生类成员
- 递归模板化函数不能分配给具有常量限定类型"const tt &"的变量"state"
- 使用取消引用的指针的多态性会产生意外的结果.为什么?