macOS配置Clion用于STM32开发找不到stdint.h等头文件问题解决方案

问题

编译报错发现是arm-none-eabi-gcc版本低于11[1],于是通过brew升级
升级后编译工程时出现大量类似错误如下

/opt/homebrew/Cellar/arm-none-eabi-gcc/13.2.0/lib/gcc/arm-none-eabi/13.2.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory

问题原因

不能使用brew install arm-none-eabi-gcc安装编译工具链[2]

解决方案

打开终端输入命令[3]

brew uninstall arm-none-eabi-gcc
brew autoremove
brew install --cask gcc-arm-embedded

  1. non constant or forward reference address expression for section .ARM.extab 错误解决 ↩︎

  2. 在M2芯片上配置Clion编译和下载stm32 ↩︎

  3. Compilation on MacOs - M2 #355 ↩︎

posted @ 2024-04-23 22:08  ErBW_s  阅读(329)  评论(0编辑  收藏  举报