I am trying to use the library Armadillo in my C++ code. When I try to use it, it gives me an error: "error: 'mutex' in namespace 'std' does not name a type"
I get the same error with the following minimalist implementation:
#include <iostream>
#include <mutex>
std::mutex mtx;
int main () {
return 0;
}
I think the "mutex" library is simply not there. I am using Windows, G++ 8.1.0, MinGW-w64, and SublimeText for editing. I am adding -std=c++11 when running the file. I run the file using the following command (try_mutex.cpp is a file with the previous code):
g++ -std=c++11 try_mutex.cpp
The output is as follows:
try_mutex.cpp:3:6: error: 'mutex' in namespace 'std' does not name a type
std::mutex mtx;
^~~~~
try_mutex.cpp:3:1: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
+#include <mutex>
std::mutex mtx;
^~~