Skip to content

Instantly share code, notes, and snippets.

@ofosos
Created Mar 10, 2018
Embed
What would you like to do?
GCC fails to compile stdlib stuff for C++ 11
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;
^
#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