How to specify compiler / system headers?

I upgraded my Centos 5.5 computer from GCC version 4.1.2 to GCC 4.7.2, however when I try to use certain C++11 features (such as unique_ptr), CLion doesn't recogize them because it thinks I'm including the GCC 4.1.2 system headers (<memory>) instead of the 4.7.2 headers. Builds succeed, but the CLion parser doesn't recognize the C++11 features even though I have enabled c++11 through CMAKE_CXX_FLAGS, and I have updated the CMake cache's CMAKE_CXX_COMPILER to point to the 4.7.2 GCC compiler. How can I get CLion to find the right system header files?

1 comment
Comment actions Permalink

Hi Cary.

Could you please try to use method #2 from pass
-D CMAKE_C_COMPILER=<your_path_to_c_compiler>  -D CMAKE_CXX_COMPILER=<your_path_to_cxx_compiler>
to Preferences (Settings) | Build, Execution, Deployment | CMake | CMake options.
Then corresponding CMake cache variables will be overwritten respectively.

Please sign in to leave a comment.