后续我手动的把cpp 诊断日志中没有扫描出来的system include添加到了eide的include path中,问题似乎勉强解决了,但这显然并没有根治。
原因应该还是我在对eide的设置有问题,我还是希望能够根治一下这个问题。
以下是eide为我生辰的工程warning:
!!! 警告 !!!
在 eclipse 和 eide 之间有一些不兼容的参数,您需要检查并手动添加到 eide 项目 !
当你解决了这些不兼容的参数,你需要删除这个提示文件,否则这个文件还会再次显示 !
---
##### Configurations For All Targets #####
//
///// Target: 'Debug' /////
//
Incompatible Args:
/:
globalArgs:
- <MCU> = STM32F407ZETx
- <CPU> = 0
- <Core> = 0
- <Floating-point unit> = com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.fpv4-sp-d16
- <Floating-point ABI> = com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard
- <Board> = genericBoard
- "<Defaults> = com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32F407ZETx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32F4xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32F407xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32F407ZETX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || "
- <Cpu clock frequence> = 16
cIncDirs: []
cMacros: []
cCompilerArgs:
- <Debug level> = com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g3
- <Optimization level> = undefined
- <Debug level> = com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g3
- <Language standard> = com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.languagestandard.value.gnupp17
sIncDirs: []
sMacros: []
assemblerArgs:
- <Debug level> = com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3
- <Include paths (-I)> = undefined
linkerArgs: []
linkerLibArgs: []
//
///// Target: 'Release' /////
//
Incompatible Args:
/:
globalArgs:
- <MCU> = STM32F407ZETx
- <CPU> = 0
- <Core> = 0
- <Floating-point unit> = com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.fpv4-sp-d16
- <Floating-point ABI> = com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard
- <Board> = genericBoard
- "<Defaults> = com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32F407ZETx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32F4xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32F407xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32F407ZETX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || "
- <Cpu clock frequence> = 16
cIncDirs: []
cMacros: []
cCompilerArgs:
- <Debug level> = com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0
- <Optimization level> = com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os
- <Debug level> = com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g0
- <Optimization level> = com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os
- <Language standard> = com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.languagestandard.value.gnupp17
sIncDirs: []
sMacros: []
assemblerArgs:
- <Debug level> = com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0
linkerArgs: []
linkerLibArgs: []
以下是我的eide.json
{
"name": "407ZET6",
"type": "ARM",
"dependenceList": [],
"srcDirs": [
"Core",
"Drivers",
"Usr"
],
"virtualFolder": {
"name": "<virtual_root>",
"files": [],
"folders": []
},
"outDir": "build",
"deviceName": null,
"packDir": null,
"miscInfo": {
"uid": "43fa2cb086dede9f33940d8531ae6949"
},
"targets": {
"Debug": {
"excludeList": [],
"toolchain": "GCC",
"compileConfig": {
"cpuType": "Cortex-M4",
"floatingPointHardware": "single",
"scatterFilePath": "STM32F407ZETX_FLASH.ld",
"useCustomScatterFile": true,
"storageLayout": {
"RAM": [],
"ROM": []
},
"options": "null"
},
"uploader": "STLink",
"uploadConfig": {
"bin": "",
"proType": "SWD",
"resetMode": "default",
"runAfterProgram": true,
"speed": 4000,
"address": "0x08000000",
"elFile": "None",
"optionBytes": ".eide/debug.st.option.bytes.ini",
"otherCmds": ""
},
"uploadConfigMap": {
"JLink": {
"bin": "",
"baseAddr": "",
"cpuInfo": {
"vendor": "null",
"cpuName": "null"
},
"proType": 1,
"speed": 8000,
"otherCmds": ""
}
},
"custom_dep": {
"name": "default",
"incList": [
"Core/Inc",
"Drivers/STM32F4xx_HAL_Driver/Inc",
"Drivers/STM32F4xx_HAL_Driver/Inc/Legacy",
"Drivers/CMSIS/Device/ST/STM32F4xx/Include",
"Drivers/CMSIS/Include",
"Usr",
"Usr/tools",
//"../../../../Program Files/ST/STM32CubeIDE_1.16.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623/tools/arm-none-eabi/include/c++/12.3.1/arm-none-eabi/thumb/v7e-m+fp/hard"
],
"libList": [],
"defineList": [
"DEBUG",
"USE_HAL_DRIVER",
"STM32F407xx"
]
},
"builderOptions": {
"GCC": {
"version": 5,
"beforeBuildTasks": [],
"afterBuildTasks": [],
"global": {
"$float-abi-type": "hard",
"output-debug-info": "enable"
},
"c/cpp-compiler": {
"language-c": "c11",
"language-cpp": "c++11",
"optimization": "level-debug",
"warnings": "all-warnings",
"one-elf-section-per-function": true,
"one-elf-section-per-data": true
},
"asm-compiler": {
"ASM_FLAGS": "-DDEBUG"
},
"linker": {
"output-format": "elf",
"remove-unused-input-sections": true,
"LD_FLAGS": "-TSTM32F407ZETX_FLASH.ld -lstdc++",
"$toolName": "auto"
}
}
}
},
"Release": {
"excludeList": [],
"toolchain": "GCC",
"compileConfig": {
"cpuType": "Cortex-M3",
"floatingPointHardware": "none",
"scatterFilePath": "",
"useCustomScatterFile": true,
"storageLayout": {
"RAM": [],
"ROM": []
},
"options": "null"
},
"uploader": "STLink",
"uploadConfig": {
"bin": "",
"proType": "SWD",
"resetMode": "default",
"runAfterProgram": true,
"speed": 4000,
"address": "0x08000000",
"elFile": "None",
"optionBytes": ".eide/debug.st.option.bytes.ini",
"otherCmds": ""
},
"uploadConfigMap": {
"JLink": {
"bin": "",
"baseAddr": "",
"cpuInfo": {
"vendor": "null",
"cpuName": "null"
},
"proType": 1,
"speed": 8000,
"otherCmds": ""
}
},
"builderOptions": {
"GCC": {
"version": 5,
"beforeBuildTasks": [],
"afterBuildTasks": [],
"global": {
"$float-abi-type": "softfp",
"output-debug-info": "enable",
"misc-control": []
},
"c/cpp-compiler": {
"language-c": "c11",
"language-cpp": "c++11",
"optimization": "level-debug",
"warnings": "all-warnings",
"one-elf-section-per-function": true,
"one-elf-section-per-data": true,
"C_FLAGS": "",
"CXX_FLAGS": ""
},
"asm-compiler": {
"ASM_FLAGS": ""
},
"linker": {
"output-format": "elf",
"remove-unused-input-sections": true,
"LD_FLAGS": "-TSTM32F407ZETX_FLASH.ld",
"LIB_FLAGS": ""
}
}
},
"custom_dep": {
"name": "default",
"incList": [
"Core/Inc",
"Drivers/STM32F4xx_HAL_Driver/Inc",
"Drivers/STM32F4xx_HAL_Driver/Inc/Legacy",
"Drivers/CMSIS/Device/ST/STM32F4xx/Include",
"Drivers/CMSIS/Include",
"Usr",
"Usr/tools"
],
"defineList": [
"USE_HAL_DRIVER",
"STM32F407xx"
],
"libList": []
}
}
},
"version": "3.5"
}
十分感谢您的帮助。