In file included from /usr/include/c++/4.8/thread:35:0,
from prog.cpp:2:
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
prog.cpp:7:10: error: ‘unique_lock’ in namespace ‘std’ does not name a type
typedef std::unique_lock<std::mutex> lock_t;
^
prog.cpp:19:2: error: ‘lock_t’ does not name a type
lock_t getLock() {
^
prog.cpp:30:2: error: ‘mutex’ in namespace ‘std’ does not name a type
std::mutex m;
^
prog.cpp: In constructor ‘Test::Test()’:
prog.cpp:10:5: error: class ‘Test’ does not have any field named ‘m’
: m()
^
prog.cpp: In function ‘void worker()’:
prog.cpp:42:2: error: ‘lock_t’ is not a member of ‘Test’
Test::lock_t lk = test.getLock(); // ここでロック
^
prog.cpp:42:15: error: expected ‘;’ before ‘lk’
Test::lock_t lk = test.getLock(); // ここでロック
^
prog.cpp: In function ‘int main()’:
prog.cpp:48:2: error: ‘thread’ is not a member of ‘std’
std::thread th1(worker);
^
prog.cpp:48:14: error: expected ‘;’ before ‘th1’
std::thread th1(worker);
^
prog.cpp:49:2: error: ‘thread’ is not a member of ‘std’
std::thread th2(worker);
^
prog.cpp:49:14: error: expected ‘;’ before ‘th2’
std::thread th2(worker);
^
prog.cpp:50:2: error: ‘th1’ was not declared in this scope
th1.join();
^
prog.cpp:51:2: error: ‘th2’ was not declared in this scope
th2.join();
^