是什么会导致我的源文件在文件图标中以删除线显示为灰色? [英] What would cause my source files to be greyed out with a strikethrough through the file icon?

查看:59
本文介绍了是什么会导致我的源文件在文件图标中以删除线显示为灰色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Eclipse Mars为STM32F4 Discovery板构建应用程序。特别是,我想使用SPI库。我已经在主程序中包含了相应的头文件,但是却收到错误消息,表明我要使用的函数未定义。

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?

推荐答案

变灰/划掉的文件表示文件已

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

要排除/包含,请右键单击该文件,然后选择 Resource Configurations -> *从构建中排除。 。。

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

您应该看到这样的GUI:

You should be presented with a GUI like this:

,那么您应该能够更新排除哪些构建配置。

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

如果要进行大量编辑,有时您会发现查看甚至编辑 .cproject xml文件。例如,这是我的 .cproject

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>

这篇关于是什么会导致我的源文件在文件图标中以删除线显示为灰色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆