解决方法:
在编译和链接的同时指定参数-pthread。
g++ -c main.cpp -pthread -std=c++11 // 编译 g++ main.o -o main.out -pthread -std=c++11 // 链接
VS中,在下述位置添加-pthread选项:
粤公网安备44010602011869号
粤ICP备13031080号-1