4
가능한 중복은 :
Why does this simple std::thread example not work?는왜이 프로그램은 'std :: system_error'를 던집니까?
코드 :
#include <iostream>
#include <thread>
void f()
{
std::cout << "hi thread" << std::endl;
}
int main()
{
std::thread t(f);
std::cout << "hi" << std::endl;
t.join();
}
문제 :
$ g++ -o thread_test thread_test.cpp -std=c++0x
$ ./thread_test
terminate called after throwing an instance of 'std::system_error'
what(): Operation not permitted
Abortado
"Abortado"이란 "중단"내가 내 로케일.
누군가가 버그 보고서 나 전자 메일 체인 또는 누군가가 왜 링커 오류로 발생하지 않는지에 대한 정당성을 설명 할 수 있습니까? 그러면이 코드를 잡아 내야하는 링커 오류가 아닌 방법은 무엇입니까? –
@Kevin 아주 흥미로운 질문입니다. 나는 온라인으로 답변을 찾을 수 없다. 누군가가 당신에게 힌트를 주는지를보기 위해, 단지 코멘트가 아닌 새로운 스레드에서 그 질문을하고 싶을지도 모른다. – mfontanini