[CMake] The C compiler "/usr/bin/cc" is not able to compile a simple test program.

Nils Gladitz nilsgladitz at gmail.com
Sun Jul 30 05:38:01 EDT 2017


On 30.07.2017 10:54, Micha Hergarden wrote:
> On 30-07-17 04:36, jupiter wrote:
>> I thought if I add -DCMAKE_CC_COMPILER=gcc that error should go, no, 
>> it still compile with the specific default cc:

The corresponding CMake cache variable for the C compiler is 
CMAKE_C_COMPILER (note C not CC).

Also note if the C compiler has already been configured for a build tree 
it can not simply be changed.
Which is also why the CC environment variable has no effect on build 
trees where the C compiler is already configured.

Nils


More information about the CMake mailing list