简体   繁体   English

如何获取从Eclipse CDT中的构建配置中排除的文件?

[英]How to get back a file that was excluded from a build configuration in Eclipse CDT?

Using Indigo and a managed build C++ project, I right-clicked on a source file and selected Resource Configurations->Exclude From Build... , and the file promptly disappears. 使用Indigo和托管构建C ++项目,我右键单击源文件并选择Resource Configurations->Exclude From Build... ,文件立即消失。 Scrolling down shows it at the bottom of the list of source files with a new dimmed icon. 向下滚动会在源文件列表的底部显示一个新的灰色图标。 Now how do I get it back? 现在我该如何取回它? The Reset to Default... option is always dimmed out. Reset to Default...选项始终显示为灰色。 Right-clicking on the excluded file still only shows the Exclude From Build... option. 右键单击排除的文件仍然只显示“ Exclude From Build...选项。 Is there an Include in Build option somewhere? Include in Build某处有一个Include in Build选项中吗? I realize I can go to .cproject file and manually edit it back in but I figure there must be a way to do it from the IDE. 我意识到我可以转到.cproject文件并手动编辑它,但我认为必须有一种方法可以从IDE中执行此操作。

Yes this is an old question. 是的,这是一个老问题。 But people do go looking for answers years later.. 但人们会在几年后去寻找答案。

There's an easy way, but it's counter intuitive. 有一种简单的方法,但这是违反直觉的。 Right click the excluded item, select "exclude from build", and on the dialog that appears, uncheck the builds for which you'd like the item back. 右键单击排除的项目,选择“从构建中排除”,然后在出现的对话框中, 取消选中您希望该项目返回的构建。 Note the convenient 'Deselect All' button. 请注意方便的“取消全选”按钮。

In eclipse there's not a similar way to reinclude resource, like: 在eclipse中,没有类似的方法来重新包含资源,例如:

  • Resource Configuration -> Reinclude from build 资源配置 - >从构建中重新包含

You need to go in Project Proprerties (Alt+Enter) and go: 您需要进入Project Proprerties(Alt + Enter)并转到:

C/C++ General -> Paths and Symbols

Select tab 选择标签

Source Location

and expand your project's folder: here you can select filter that you want to remove and click on " Edit Filter " and then " Remove ". 并展开项目的文件夹:在这里,您可以选择要删除的过滤器 ,然后单击“ 编辑过滤器 ”,然后单击“ 删除 ”。

While I still don't know how get back a file that's been excluded. 虽然我仍然不知道如何取回已被排除的文件。 I have discovered that it's much better to just add a new folder, and then mark the folder as excluded. 我发现只添加一个新文件夹,然后将该文件夹标记为已排除,这样会好得多。 Then files can be excluded by dragging them into this folder and included back by dragging them back to the original folder. 然后可以通过将文件拖到此文件夹中将文件排除,然后将其拖回原始文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM