在浏览C++0x中的一本货币书时,我想我应该运行一下示例代码。它是最基本的。
#include <iostream>
#include <thread>
void hello()
{
std::cout<<"Hello Concurrent World\n";
}
int main(int argc, char *argv[])
{
std::thread t(hello);
t.join();
}编译时使用:
g++ -std=c++0x -g -o pgm pgm.cpp热潮伴随着:
Program received signal SIGSEGV, Segmentation fault.
_dl_fixup (l=0x7ffff7b0992c, reloc_arg=<value optimized out>) at ../elf/dl-runtime.c:147
147 ../elf/dl-runtime.c: No such file or directory.
in ../elf/dl-runtime.c似乎是某种设置/库问题。有人熟悉这个吗?
发布于 2010-08-08 05:10:01
您需要使用-pthread标志编译/链接。
https://stackoverflow.com/questions/3432039
复制相似问题