Earlier today I was trying to get my project to compile with the g++ option, "-std=c++11". Being new to both Qt Creator & CMake, I thought that the place to put this option was under Tools -> Options -> Build & Run -> Compilers -> Platform codegen flags. I quickly found out that this isn't where it goes, and after some searching, learned that I should adding this to my CMakeLists.txt: "ADD_DEFINITIONS( -std=c++11 )". Good enough.

Now, I'm trying to add the g++ option, "-lpthread". This time, I tried adding in CMakeLists.txt like this: "ADD_DEFINITIONS( -std=c++11 -lpthread)". This didn't do the trick, so I tried adding "-pthread" in Tools -> Options -> Build & Run -> Compilers -> Platform linker flags. This didn't work for me either.

Where should I be trying to add this option?

Thanks.