The default GCC in Linux-Mint is not up to date. To install the latest version, follow these steps:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install gcc-5 g++-5
Now if you execute in a terminal
g++-5 –version
You should get the correct version.
Next, in CLion, go to Settings -> Build, Execution, Deployment -> CMake. Under CMake options, add
-D CMAKE_CXX_COMPILER=g++-5
That should do it.
In general, note that CLion just uses CMake to do the compiling, so its really CMake that you have to configure to use a different compiler. More details on how to do this can be found here:
https://cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F