Anurag Ingole
Anurag Ingole

Reputation: 97

gcc version issue on CentOS system

I am working on CentOS system which has gcc version 4.4.7. For installation of clang it needs the gcc version to be 4.7 or above. Hence I installed devtools and after running :

scl enable devtoolset-1.1 bash
gcc -v

It shows the version to be 4.7 but CMAKE_CXX_COMPILER_VERSION still shows it to be 4.4.7 How to solve this issue?

Upvotes: 1

Views: 541

Answers (1)

Finn
Finn

Reputation: 1056

CMake prefers the default compiler of the system, even when another compiler appears in PATH first. However you can set CC and CXX to force a different compiler.

CC=gcc CXX=g++ cmake ..

Upvotes: 3

Related Questions