Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/130.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何获得新的C++;Mac OS X上的线程支持与clang?_C++_Macos_C++11_Clang - Fatal编程技术网

C++ 如何获得新的C++;Mac OS X上的线程支持与clang?

C++ 如何获得新的C++;Mac OS X上的线程支持与clang?,c++,macos,c++11,clang,C++,Macos,C++11,Clang,我只想在Mac OSX 10.8上使用Apple clang版本4.1(tags/Apple/clang-421.11.66)编译以下程序: #包括 使用名称空间std; int main(){ cout您需要使用新的libc++,这不是默认值: clang++ -stdlib=libc++ threadtest.cpp (当然,您还需要包括iostream,但我想这并不是您的困惑。)您好,谢谢您的帮助。现在我得到了“std::\uuu 1::locale::use_facet(std:\u

我只想在Mac OSX 10.8上使用Apple clang版本4.1(tags/Apple/clang-421.11.66)编译以下程序:

#包括
使用名称空间std;
int main(){

cout您需要使用新的
libc++
,这不是默认值:

clang++ -stdlib=libc++ threadtest.cpp 

(当然,您还需要包括iostream,但我想这并不是您的困惑。)

您好,谢谢您的帮助。现在我得到了“std::\uuu 1::locale::use_facet(std:\uu 1::locale::id&)const”链接时,但这似乎是我的CDT设置的一个问题。仅供参考,这是近3年后的默认设置。这是一个许多问题的dup,苹果只提供一个古老的GCC,所以它的库不支持C++11,您需要为C++11功能使用替代的libc++库,请参阅,或安装一个更新的GCC
../src/FirstCAgain.cpp:13:10: fatal error: 'thread' file not found
#include <thread>
clang++ -stdlib=libc++ threadtest.cpp