std:macOS上的线程:libc ++ abi.dylib:终止

时间:2018-02-05 03:22:33

标签: c++ multithreading macos

运行以下非常简单的代码

#include <thread>
#include <iostream>

using namespace std;

void test() {cout << "hello" << endl;}

int main(){

    thread t(test);
    t.join();
}

编译
  

g ++ -std = c ++ 14 -pthread multi.cc

在macOS10.12.6上使用clang 900.0.38,程序显示

  

libc ++ abi.dylib:终止中止陷阱:6

有谁知道可能导致此行为的原因?

0 个答案:

没有答案