我正在开发一个具有大量现有代码库的电表,并尝试引入一些自动化测试。我编写了一个python脚本来解码ARM的Keil项目文件并生成一个makefile。因此,大多数定义和包含路径实际上是在keil项目文件中定义的。实际上,我添加了很多定义。
除了从一些编译命令中删除前几个字符之外,所说的makefile很棒。下面的两行是良好的编译命令和坏的编译命令的示例。很容易看到“g ++ - ”已经从编译命令的开头被剥离了。
总是那5个字符。我提到的一个提示是失败的文件路径相对较长。
定义SHELL = / bin / bash不会改变任何内容。
g ++ -c ../Project/External/HAL/src/HWRNG.cpp -o obj / HWRNG.o -D IO =“” - D __I =“” - D __packed =“” - D ubyte8 =“unsigned long long”-std = c ++ 11 -w -fpermissive -D __GNUC -D __USE_C99_MATH -D LOGICAL_NAME_REFERENCING -D EOSAL_NAMESPACE = CosemMeter -D USE_RTX -D STM32F412xG -D USE_STDPERIPH_DRIVER -D HSE_VALUE = 24000000 -D DEBUG_UART -D OLD_MCOR -D ENABLE_LTE_MODEM -I ../trace -I ../trace/EOSAL/src -I patch / include -I ../Project -I ../Project/Hardware -I ../Project / External / CosemServerLib -I ../Project/External/CosemServerLib/Project -I ../Project/External/CosemServerLib/External -I ../Project/External/HAL/inc -I ../Project/External/HAL / STM / 32F4xx / drivers / inc -I ../Project/External/STM32F4xx/CMSIS/Device/ST/STM32F4xx/Include -I ../Project/External/STM32F4xx/CMSIS/Include -I ../Project/External / STM32F4xx / STM32F4xx_StdPeriph_Driver / inc -I ../Project/lib -I ../Project/lib/RTX/inc -I ../Project/lib/RTX/inc/RTL -I ../Project/lib/Mocana / src -I ../Project/Middlewares/Segger/USBH -I .. / Project / Middlewares / Segger / Inc -I ../Project/SeggerCfg -I ../ Project / LTE / inc
c ../Project/External/HAL/STM/32F4xx/drivers/src/EXTI_Driver.c -o obj / EXTI_Driver.o -D __IO =“” - D __I =“” - D __packed =“” - D ubyte8 =“unsigned long long”-D __USE_C99_MATH -D LOGICAL_NAME_REFERENCING -D EOSAL_NAMESPACE = CosemMeter -D USE_RTX -D STM32F412xG -D USE_STDPERIPH_DRIVER -D HSE_VALUE = 24000000 -D DEBUG_UART -D OLD_MCOR -D ENABLE_LTE_MODEM -I ../trace -I ../trace/EOSAL/src-I patch / include -I ../Project -I ../Project/Hardware -I ../Project/External/CosemServerLib -I ../Project/External/CosemServerLib/Project - 我../Project/External/CosemServerLib/External -I ../Project/External/HAL/inc -I ../Project/External/HAL/STM/32F4xx/drivers/inc -I ../Project/External/ STM32F4xx / CMSIS / Device / ST / STM32F4xx / Include -I ../Project/External/STM32F4xx/CMSIS/Include -I ../Project/External/STM32F4xx/STM32F4xx_StdPeriph_Driver/inc -I ../Project/lib -I。 ./Project/lib/RTX/inc -I ../Project/lib/RTX/inc/RTL -I ../Project/lib/Mocana/src -I ../Project/Middlewares/Segger/USBH -I。 ./Project/Middlewares/Segger/ Inc -I ../Project/SeggerCfg -I ../Project/LTE/inc / bin / sh:c:找不到命令 make:[Makefile:167:obj / EXTI_Driver.o]错误127(忽略)
答案 0 :(得分:0)
过去几周我在路上,昨天向同事展示了我的问题。他立即注意到C编译的表现如此,C ++表现得很好。我错误地定义了C comiles的CC符号。