0

I have the same problem as sashoalm here: Use C++11 in Qt Creator. Adding the -std=c++11 Flag, as Floris Vellerman suggested, solves part of the problem, but std::thread and others are still not working.

I also tried to add

QMAKE_CXXFLAGS += -pthread

to my .pro file, but that didn't help either. However, using the terminal I can compile it (when I use both flags).

How do i set it up, so that QT Creator can directly compile (all) c++11 projects?

EDIT: Details

I'm using QT Creator 2.8.1 (QT 5.0.2) in Ubuntu 12.04 (32bit) When I add both flags into the .pro file i get the output:

terminate called after throwing an instance of 'std::system_error'
  what(): Enable multithreading to use std::thread: Operation not permitted

When i compile with the terminal it works just fine on that exact project.

Community
  • 1
  • 1
MrJonas
  • 197
  • 11
  • The given answers do not work. I tested it, but just like him I could only use the terminal to compile. – MrJonas Dec 30 '13 at 18:16
  • @MrJonas Don't forget to (1) add `LIBS += -pthread` and (2) clean and rebuild the project. Does that help? – Ali Dec 30 '13 at 19:09
  • (1) was already added BUT I cleaned (2) the Project completely and now it works! - I didn't know that could change anything. Thanks alot! – MrJonas Dec 30 '13 at 19:20
  • remember to run qmake after you change pro file. – Dasun Dec 31 '13 at 08:32

0 Answers0