用Keil Assistant 1.70版本插件打开keil工程时将弹出:
点ok后,会自动在工程目录下生成.vscode文件夹
编译VScode发现找不到stdint.h
这是由于vscode没有安装编译器,没有stdint.h头文件
解决方法一:
安装编译器,不多阐述。
解决方法二:
在keil->小锤子->c/c++的Include Paths下添加stdint.h的头文件路径
文件路径在安装的keil文件夹里"F:\keil5\ARM\Installer\include
编译keil,会产生警告:"no source": Warning: #3036-D: "F:\KEIL5\keil5\ARM\Installer\include" was specified as both a system and non-system include directory -- the non-system entry will be ignored
在keil的Misc Controls里输入 --diag_suppress=3036 忽略警告
打开vscode编译不再有波浪线
由于Keil Assistant 1.70会自动同步keil的Include Paths到.vscode文件夹下的c_cpp_properties.json中,因此即使在c_cpp_properties.json中添加stdint.h的路径,下次再打开vscode时也会找不到stdint.h的路径,使用方法二则会解决这个问题。