2017-02-22 108 views
0

我正在使用Eclipse/Neon.2中的CDT项目,该项目为嵌入式目标交叉编译。我在项目中添加了一堆.c文件,除了(看起来)之外,它们自动包含在构建中。在项目目录中,它是 STM32F7explore/Utilities/Log/lcd_log.c其中STM32F7explore是Eclipse项目目录。如果我尝试手动构建它,控制台窗口显示:Eclipse/Neon.2忽略源文件

09:45:52 **** Building Selected Files of configuration Debug for project STM32F7explore **** 
Info: Internal Builder is used for build 

09:45:52 Build Finished (took 1ms) 

对于包含的文件,控制台显示例如:

09:54:50 **** Building Selected Files of configuration Debug for project STM32F7explore **** 
Info: Internal Builder is used for build 
arm-none-eabi-gcc -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F746xx -DLWIP_TIMEVAL_PRIVATE=0 -I../Inc -I../Drivers/STM32F7xx_HAL_Driver/Inc -I../Drivers/STM32F7xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F7xx/Include -I../Drivers/CMSIS/Include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1 -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Middlewares/Third_Party/LwIP/src/include -I../Middlewares/Third_Party/LwIP/system -I../Middlewares/Third_Party/LwIP/src/include/lwip -I../Middlewares/Third_Party/LwIP/src/include/lwip/apps -I../Middlewares/Third_Party/LwIP/src/include/lwip/priv -I../Middlewares/Third_Party/LwIP/src/include/lwip/prot -I../Middlewares/Third_Party/LwIP/src/include/netif -I../Middlewares/Third_Party/LwIP/src/include/netif/ppp -I../Middlewares/Third_Party/LwIP/src/include/netif/ppp/polarssl -I../Middlewares/Third_Party/LwIP/src/include/posix -I../Middlewares/Third_Party/LwIP/src/include/posix/sys -I../Middlewares/Third_Party/LwIP/system/arch -I../Drivers/BSP/STM32746G_Discovery -I../Utilities/Log -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -o Src/main.o ../Src/main.c 

09:54:51 Build Finished (took 224ms) 

我很困惑为什么Eclipse不会将lcd_log.c文件添加到构建中。我看了看文件属性弹出,他们看起来上是相同的(尤其是,Eclipse会识别lcd_log.c为File (C Source File)

我已经从项目强制Eclipse来删除从工作区.metadata/.plugins/org.eclipse.core.runtime/.settings.settings生成这些并没有解决这个问题。

该项目是在Github上(https://github.com/HankB/STM32F7explore),但建设的要求是有点陡峭,除非你碰巧要制定ST嵌入式处理器。

谢谢!

回答

1

Wh在这里进行的是Log(或其父母Utilities)目录不是您的项目源的一部分,而是排除在项目中的额外文件。

在项目浏览器中有一些视觉线索。比较两个箱子下面红色:

Src vs Log

正如你可以看到Srcdma2d.c文件使用不同的图标比Loglcd_log.c

您可以重新启用该文件夹,或单个文件,右击 - >资源配置 - >排除生成...并在弹出取消选中调试发布看起来像这样:

exclude from build pop-up

您还可以控制哪些是通过选择项目属性包括 - >C/C++通用 - >路径nd符号 - >来源地点选项卡。

我建议的是,不要让Drivers,Inc等明确包含在内,而是将所有文件都包含在项目的根目录下。为此,请选择来源位置中的所有现有条目,然后按删除。然后,您应该只有一个自动重新创建的条目/STM32F7Explore,像这样:(记住做同样的改变Debug和Release)

cleaned-up source configuration

然后,如果你真的不想要排除的文件/文件夹,请使用资源配置重复上述步骤。 CDT在这里会非常有帮助,如果你在构建中排除了源目录下的单个文件/文件夹,你将会获得另一个图标。在这里,我已经排除了一个单独的C文件(log_lcd.c)和字体目录:

exclude the other way

一些用于Eclipse CDT的具体帮助,涉及上述:

+0

底部我添加了一个[拉入请求(https://github.com/HankB/STM32F7explore/pull/1)到SHO w代码的变化。 –