在MacOS中,尝试在C++的多线程中传入参数,发现报错:
no matching constructor for initialization of 'std::thread'

原因:MacOS的g++使用clang,默认不支持C++11多线程。
解决方法:编译指令加上 -std=c++11
例如:g++ -std=c++11 fileToCompile.cpp -o outputFile.out

相关文章:

  • 2022-12-23
  • 2021-05-23
  • 2022-12-23
  • 2021-12-20
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
相关资源
相似解决方案