-
-
Save ofosos/6d780a488b350b5f1e71f0b9c3982590 to your computer and use it in GitHub Desktop.
GCC fails to compile stdlib stuff for C++ 11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mark@thukydides ~$ c++ -O2 -Wall -std=c++11 -lpthread -c test.cpp | |
test.cpp: In function ‘int main()’: | |
test.cpp:10:3: error: ‘mutex’ is not a member of ‘std’ | |
std::mutex foo; | |
^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <thread> | |
#include <mutex> | |
int main() | |
{ | |
int n[] = {4,7,6,1,2}; | |
int r; | |
auto f = [&](int j) { r = j; }; | |
std::mutex foo; | |
for (auto i : n) | |
f(i); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment