Simple program like this
#include <iostream> // std::cout
#include <thread> // std::thread
#include <mutex> // std::mutex
std::mutex mtx; // mutex for critical section
int main ()
{
return 0;
}
Tried the following to compile
$ /usr/local/Cellar/gcc46/4.6.4/bin/g++-4.6 -std=gnu++0x -I/usr/local/Cellar/gcc46/4.6.4/gcc/include/c++ -L/usr/local/Cellar/gcc46/4.6.4/gcc/lib temp_mutex.cpp
temp_mutex.cpp:6:1: error: 'mutex' in namespace 'std' does not name a type
By the way I am compiling on Mac.
It worked for me:
None of these generated any error messages.