c++11编译错误 Enable multithreading to use std::thread: Operation not permitted
来源:互联网 发布:软件著作权 邮寄证书 编辑:程序博客网 时间:2024/06/11 22:34
最近用codenvy练习c++11,除了延时和模板少,其他还是很好用的。codenvy中默认的c++编程呢环境是ubuntu 14 + gcc 4.8.4,运行g++ -std=c++11 mai.cpp时报错:
terminate called after throwing an instance of 'std::system_error' what(): Enable multithreading to use std::thread: Operation not permittedAborted (core dumped)
一度以为是权限问题,但是不是。google后发现,这是gcc中一个bug造成的,具体讨论点这里。
解决方案搬到这里来:
qt+gcc运行:
LIBS += -pthreadQMAKE_CXXFLAGS += -pthreadQMAKE_CXXFLAGS += -std=c++11
console g++运行:
g++ -c main.cpp -pthread -std=c++11 // generate target object file without linkg++ main.o -o main.out -pthread -std=c++11 // link to target binary或者是g++ main.cpp -pthread -std=c++11 //generate target excutable file with target object and link
如果没作用,尝试:
g++ main.cpp -Wl,--no-as-needed -lpthread -std=c++11
0 0
- c++11编译错误 Enable multithreading to use std::thread: Operation not permitted
- g++编译C++11遇到的问题:Enable multithreading to use std::thread: Operation not permitted
- Enable multithreading to use std::thread: Operation not permitted
- Enable multithreading to use std::thread: Operation not permitted
- c++ g++运行出现Enable multithreading to use std::thread: Operation not permitted解决
- 解决错误。remount failed:Operation not permitted
- QtCreator: ptrace operation not permitted错误解决方法
- gethostbyname返回错误Operation not permitted解决办法
- XenOprof 错误 Failed to open profile device: Operation not permitted 的解决
- setgid: Operation not permitted
- ptrace: Operation not permitted.
- Operation not permitted解决方法
- Operation not permitted
- ln: operation not permitted
- Operation not permitted
- Unable to set scheduler to SCHED_FIFO (Operation not permitted)
- GDB: Failed to set controlling terminal: Operation not permitted\n
- Failed to get D-Bus connection: Operation not permitted
- OpenJudge noi 1159Maze(poj 2157)
- 最小生成树
- log4j详细配置
- 利用unity3d自带的CharacterController包制作第一人称控制模型的简单Demo
- 导论
- c++11编译错误 Enable multithreading to use std::thread: Operation not permitted
- python拷贝对象
- [2016-10-15]Java中static的使用
- leveldb源码分析
- SQL server 连接字符串
- delphi7 TADODataSet TDBGridExt 简单应用
- Android自动化测试之Robotium之学习一
- codeVS 3115 高精度练习之减法
- 数据结构实验之栈一:进制转换(java实现)