CMake reports GCC is broken. Where do I start?

前端 未结 2 1712
醉话见心
醉话见心 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.

提交回复
热议问题