CLion: Error:The C compiler “C:/MinGW/bin/gcc.exe” is not able to compile a simple test program

后端 未结 2 520
傲寒
傲寒 2021-01-02 03:35

I\'m trying to run CLion on windows 7 with MinGW but for some reason CMake can\'t compile the simple test program but when I create a simple hello world file it compiles jus

2条回答
  •  青春惊慌失措
    2021-01-02 04:12

    With a dummy cmake project (A CMakeLists.txt with simply cmake_minimum_required(VERSION 2.8) and add_executable(helloWorld ).), we have established that the compiler and CLion are not the problem, so it's probably something to do with make. Here was the log.

    My guess is that you have msys in your path. If sh.exe is in your path, it is known to cause problems.

    As a safe alternative, you can decide to use ninja as an alternative to make (cmake supports it experimentally, but in practice it supports it pretty well). Here you can find prebuilt packages (in fact, it's just one executable you have to put in your path).

    Ninja integration within CLion should work just fine.

提交回复
热议问题