CMake reports GCC is broken. Where do I start?

前端 未结 2 1711
醉话见心
醉话见心 2021-02-13 19:21

I am trying to compile a project, but CMake stops right at the beginning with the message that gcc is broken (see below). I am ignoramus when it comes to CMake, so any help wher

相关标签:
2条回答
  • 2021-02-13 20:07

    Check this link.

    I had the same problem. I think the problem is that you need more parameters to compile (like linker-script, flags ...). Change your CMakeLists.txt like this and try it again:

    INCLUDE(CMakeForceCompiler)
    CMAKE_FORCE_C_COMPILER(gcc GNU)
    CMAKE_FORCE_CXX_COMPILER(g++ GNU)
    

    Do not forget to set the path to the compiler in your environment variables.

    0 讨论(0)
  • 2021-02-13 20:08

    Same happened with me, in CLion.

    Check if your compilers and other things are properly installed and/or configured.

    I Re-installed the GCC Compiler and the CMake, then reconfigured my IDE.

    and it worked for me since then!

    0 讨论(0)
提交回复
热议问题