I just want to compile the following program on Mac OSX 10.8 using Apple clang version 4.1 (tags/Apple/clang-421.11.66):
#include <thread>
using namespace std;
int main() {
cout << "Hello world";
}
But I get:
../src/FirstCAgain.cpp:13:10: fatal error: 'thread' file not found
#include <thread>
I enabled c++11 support and I'm using the Eclipse C/C++ Development Tooling.
The question is: How do I get the new C++ threading support on Mac OS X ?
You need to use the new libc++
, which isn't the default:
clang++ -stdlib=libc++ threadtest.cpp
(Of course you also need to include iostream, but I assume that wasn't you confusion.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With