C++11多线程程序运行错误

编译没有问题,错误如图:

错误原因:

http://stackoverflow.com/questio ... ation-not-permitted
gcc4.6以后对于ld自动加上了as-needed选项。所以编译选项应该变成:
g++ -Wl,--no-as-needed -std=c++11 -pthread a.cpp

posted @ 2014-09-19 10:16  2805101015  Views(201)  Comments(0Edit  收藏  举报