rog*_*rgl 8 c++ macos clang c++11
我只想使用Apple clang 4.1版(标签/ Apple/clang-421.11.66)在Mac OSX 10.8上编译以下程序:
#include <thread>
using namespace std;
int main() {
cout << "Hello world";
}
Run Code Online (Sandbox Code Playgroud)
但我得到:
../src/FirstCAgain.cpp:13:10: fatal error: 'thread' file not found
#include <thread>
Run Code Online (Sandbox Code Playgroud)
我启用了c ++ 11支持,并且我正在使用Eclipse C/C++ Development Tooling.
问题是:如何在Mac OS X上获得新的C++线程支持?
Rob*_*ier 10
您需要使用new libc++,这不是默认值:
clang++ -stdlib=libc++ threadtest.cpp
Run Code Online (Sandbox Code Playgroud)
(当然你还需要包含iostream,但我认为这不是你的困惑.)
| 归档时间: |
|
| 查看次数: |
4553 次 |
| 最近记录: |