首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Clion (stm32嵌入式开发) CMake未找到arm-none-eabi-gcc编译器

Clion (stm32嵌入式开发) CMake未找到arm-none-eabi-gcc编译器
EN

Stack Overflow用户
提问于 2020-04-17 03:30:36
回答 1查看 1.3K关注 0票数 1

我做了一个像tutorial https://blog.jetbrains.com/clion/2019/02/clion-2019-1-eap-clion-for-embedded-development-part-iii/?gclid=CjwKCAjwhOD0BRAQEiwAK7JHmKUzvoJnORtCn3YxpsSb00Ep_dE0gNQOytiXVgFj6EXOjyCAIH9XTBoCngQQAvD_BwE&gclsrc=aw.ds这样的项目

我从https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads获得了arm工具链

通过.bashrc将bin文件夹添加到PATH。控制台命令运行正常:

代码语言:javascript
运行
复制
$ arm-none-eabi-gcc
arm-none-eabi-gcc: fatal error: no input files

在使用STM32CubeMX cmake在Clion中创建项目后,未进行配置:

代码语言:javascript
运行
复制
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: arm-none-eabi-gcc
CMake Error at CMakeLists.txt:34 (PROJECT):
  The CMAKE_C_COMPILER:

    arm-none-eabi-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.

但是bin文件夹已经在PATH中!

如果通过pacman安装toolchail或将bin文件夹的所有内容复制到/usr/bin/中,但没有找到其他文件,如nano.specs,nosys.specs,stdint.h和其他包含的文件,请查看编译器。

我不知道如何将Clion和CubeMX指向工具链的正确路径。

EN

回答 1

Stack Overflow用户

发布于 2020-04-18 01:00:00

您的cmake似乎找不到C/C++编译器。在CLion工具链设置中,您可以指定编译器的路径(在您的示例中为arm-none-eabi-gcc和arm-none-eabi-g++ ),或者只需通过CMAKE_C_COMPILERCMAKE_CXX_COMPILER定义将它们传递给CMkae。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61258547

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档