通过.bashrc将bin文件夹添加到PATH。控制台命令运行良好:
$ arm-none-eabi-gcc
arm-none-eabi-gcc: fatal error: no input files
在Clion中使用STM32CubeMX cmake创建项目后未配置:
-- 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如何指向正确的工具链。
似乎您的cmake找不到C / C ++编译器。在CLion工具链设置中,您可以指定编译器的路径(在您的情况下为arm-none-eabi-gcc和arm-none-eabi-g ++),或仅通过CMAKE_C_COMPILER
和CMAKE_CXX_COMPILER
定义将其传递给CMkae。