在MacOS中,尝试在C++的多线程中传入参数,发现报错:no matching constructor for initialization of 'std::thread'
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
-std=c++11
g++ -std=c++11 fileToCompile.cpp -o outputFile.out
Powered by: 博客园 Copyright © 2024 xxxxxxxx1x2xxxxxxx Powered by .NET 9.0 on Kubernetes