future::get() 抛出异常Unknown error -1
来源:互联网 发布:免费网站域名注册 编辑:程序博客网 时间:2024/05/22 17:05
系统:centos7
语言:c++
测试代码:a.cpp
#include <list>
#include <future>
using namespace std;
list<int> f(list<int> l)
{
return l;
}
int main()
{
list<int> l;
std::future<list<int> > fut(async(&f,move(l)));
fut.get();
return 0;
}
编译命令:g++ a.cpp
抛出异常原因:async启动了另一个线程,而编译时没有连接线程库。
修复方法:
编译命令改为:g++ a.cpp -lpthread
阅读全文
0 0
- future::get() 抛出异常Unknown error -1
- unknown error: cannot get automation extension
- Atitit. Dwr 抛出异常error解决方案
- MongoDb 抛出"Error retrieving nonce"异常
- ORACLE中 抛出异常1
- OpenCV异常:Unknown error code -49(Deallocation error)”
- MySQL异常:ERROR 1045 (28000): Unknown error 1045
- Future异常
- 抛出异常
- 抛出异常
- 抛出异常
- 抛出异常
- 抛出异常
- 抛出异常
- 抛出异常
- 抛出异常
- 抛出异常
- 抛出异常
- 一个vue项目的简单分享
- 《How to Generate a Good Word Embedding?》导读
- 吾爱破解crackme 023 024
- Binary String Matching
- jenkins 集成钉钉机器人
- future::get() 抛出异常Unknown error -1
- (CodeForces
- JavaScript之路(2)JavaScript的对象
- Python生成器
- 01背包问题(最易理解的讲解)
- 解决“suse12无法登录,显示module is unknown”问题
- js观察者模式
- ConfigurationSettings.AppSettings 已过时
- 堆排序 (包括升序和降序,Arraylist 实现)