Search code examples
c++cmakecompiler-errorsconan

Detected a mismatch for the compiler version between your conan profile settings and CMake


I had an issue with CMake who were not detecting the right version of the CMake compiler.

My CMake was working with the command line but not in CLion.

Here the output log from the CMake tool in CLion:

CMake Error at build/conanbuildinfo.cmake:1344 (message): Detected a mismatch for the compiler version between your conan profile settings and CMake: Compiler version specified in your conan profile: 9 Compiler version detected in CMake: 8.3 Please check your conan profile settings (conan profile show [default|your_profile_name])

Solution

  • The solution for this problem is to change the two path for compilation:

    Press CTRL + ALT + S to open the parameters

    Go to Build, Execution, Deployment > Toolchain

    Switch C Compiler to /usr/bin/gcc and C++ Compiler to /usr/bin/g++