gcc - MinGW 4.8.1 C++11 thread support -
i downloaded version of mingw official website: http://sourceforge.net/projects/mingw/files/ , installed on windows 7 machine.
running g++ --version gives me g++.exe (gcc) 4.8.1 , believe gcc 4.8.1 has support c++11 features, including threads.
running g++ -std=c++11 main.cpp compiles following program.
//main.cpp #include <memory> int main() { std::unique_ptr<int> a(new int); return 0; } but running g++ -std=c++11 main.cpp on following program:
//main.cpp #include <mutex> int main() { std::mutex mymutex; return 0; } gives errors:
main.cpp: in function `int main()`: main.cpp:5:5: error: 'mutex' not member of 'std' std::mutex mymutex; ^ main.cpp:5:16: error: expected ';' before 'mymutex' std::mutex mymutex; ^ as if <mutex> not supported. compiler not complain #include <mutex> have no idea why i'm getting error.
if understand well, std threading still not supported on mingw, mingw-w64 builds support it. fortunately, can still build 32-bit apps using version of mingw.
here link builds.
Comments
Post a Comment