Visual Studio Code运行Keil5程序报错

📅 2026/7/3 21:17:37 👁️ 阅读次数 📝 编程学习
Visual Studio Code运行Keil5程序报错

使用VS Code软件运行Keil5程序

程序按网络上的教程导入到VS Code后,编译报错,报错是关于找不到头文件的一串报错;

这里还有个细节是我的程序在keil里编译是不报错的。

"includes.h": No such file or directory
#include <includes.h>
".\Debug\Objects\N32.axf" - 93 Error(s), 5 Warning(s).
Target not created.

经强大的AI指导以后才找到问题所在

在keil5中编译一直选的是release版本,其中的include paths很全,但debug版本是不全的。

VS code编译的时候默认是用的debug版本,所以一直报错

魔术棒》C/C++》Include Paths

根本原因还是在Keil5的工程中

但在VS code中切换编译版本也可以解决报错

点击切换后,keil5的编译目标也都会出现,选择一样的编译目标即可