visual studio code很強(qiáng)大,現(xiàn)在已經(jīng)成為我的主力代碼編輯器强胰。在用visual studio code編碼
keil
工程時(shí)翘簇,提示variable "uint32_t" is not a type name
不是一個(gè)type類(lèi)型缠沈。
解決方法:
在c_cpp_properties.json
文件中添加相關(guān)的頭文件包含和宏定義摩渺,json片段如下:
{
"name": "Win32",
"includePath": [
"D:/Keil_v5/ARM/ARMCC/include",
"${workspaceRoot}",
"${workspaceRoot}/HARDWARE/LED",
"${workspaceRoot}/SYSTEM/delay",
"${workspaceRoot}/SYSTEM/sys",
"${workspaceRoot}/SYSTEM/usart",
"${workspaceRoot}/USER",
"${workspaceRoot}/STM32F10x_FWLib/inc",
"${workspaceRoot}/CORE",
"${workspaceRoot}/HARDWARE/KEY",
"${workspaceRoot}/SYSTEM/",
"${workspaceRoot}/HARDWARE"
],
"defines": [
"_DEBUG",
"UNICODE",
"__CC_ARM"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"D:/Keil_v5/ARM/ARMCC/include",
"${workspaceRoot}",
"${workspaceRoot}/HARDWARE/LED",
"${workspaceRoot}/SYSTEM/delay",
"${workspaceRoot}/SYSTEM/sys",
"${workspaceRoot}/SYSTEM/usart",
"${workspaceRoot}/USER",
"${workspaceRoot}/STM32F10x_FWLib/inc",
"${workspaceRoot}/CORE",
"${workspaceRoot}/HARDWARE/KEY",
"${workspaceRoot}/SYSTEM/",
"${workspaceRoot}/HARDWARE"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
注意事項(xiàng):
- 添加Keil工程頭文件路徑
D:/Keil_v5/ARM/ARMCC/include
- 添加宏定義
__CC_ARM
简烤,如果沒(méi)有該宏定義,則uint32_t
類(lèi)型會(huì)報(bào)錯(cuò)