【问题标题】:CLion CMake problemsCLion CMake 问题
【发布时间】:2016-10-09 01:18:02
【问题描述】:

在 CLion 上加载 CMake 时遇到问题。我正在尝试为 Arduino 编程设置合适的环境。

我可能遗漏了一些明显的东西,但我无法找到解决此问题的实用解决方案。谁能给我提示一下导致以下错误的原因?

Error:The CMAKE_C_COMPILER:
 avr-gcc 
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment 
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to 
the compiler, or to the compiler name if it is in the PATH.

Error:The CMAKE_CXX_COMPILER:
  avr-g++
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment 
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path 
to the compiler, or to the compiler name if it is in the PATH.

【问题讨论】:

  • 您的路径中没有合适的 C 和 C++ 编译器,至少没有名为 avr-gcc 和 avr-g++ 的编译器。要么安装它们,要么在给定的变量 CMAKE_C_COMPILER 和 CMAKE_CXX_COMPILER 中添加完整路径。
  • 嗯,我在 MinGW 中找不到任何名为“avr-gcc”或“avr-g++”的东西,只有普通的“gcc”和“g++”。
  • 然后相应地设置变量。检查相关问题和 CMake 文档。
  • 这个问题太复杂,无法用几个词来回答。 CLion 跟踪器中存在问题,problem solution 有几种方法。

标签: cmake clion


【解决方案1】:

我按照 arduino-cmake repo 中给出的步骤让它工作了。如果您在 Windows 上工作,请确保您已安装 arduino sdk。并在 sdk 中设置正确的路径。

如果您使用的是 linux,请确保您已按照 github 存储库中的 readme.md 中指定的方式安装了所有正确的依赖项。

最后但同样重要的是,确保 de cmake 目录和工具链文件存在于项目文件夹中。

https://github.com/arduino-cmake/arduino-cmake 获取正确的说明。

【讨论】:

    猜你喜欢
    • 2015-03-30
    • 2020-05-08
    • 2020-08-08
    • 2015-12-01
    • 1970-01-01
    • 2021-03-16
    • 1970-01-01
    • 2019-04-28
    • 2023-03-29
    相关资源
    最近更新 更多