What would cause my source files to be greyed out with a strikethrough through the file icon?

蹲街弑〆低调 提交于 2019-12-12 16:14:13

问题


I'm trying to build an application for the STM32F4 Discovery board using Eclipse Mars. In particular I'd like to use the SPI library. I've included the corresponding header file in my main program but am getting the error that the function I'm trying to use is undefined.

A little bit of poking and I realize that most of the source files for the project are greyed out with a bar struck through the icon.

Most I could find was people talking about how entire folders were greyed out. I've tried looking for 'greyed out icon', 'strike through', and any combination of grey, icon and bar but to no avail. Does anyone know it means if a file is greyed out and struck through?


回答1:


The greyed/striked out file means the file is excluded from the build.

To exclude/include, right click on the file and choose Resource Configurations --> *Exclude from build...".

You should be presented with a GUI like this:

and you should be able to update which build configurations are excluded.

.cproject (edit/view the xml)

If you have a lot of edits to make, sometime you may find it useful to view or even edit the .cproject xml file. For example here are some exclusions as listed in my .cproject

<sourceEntries>
    <entry excluding="final.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="othersrc"/>
    <entry excluding="dir1/third.c|other.c|hello.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>


来源:https://stackoverflow.com/questions/34127299/what-would-cause-my-source-files-to-be-greyed-out-with-a-strikethrough-through-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!