从Windows到Unix的Eclipse CDT .cproject文件 [英] Eclipse CDT .cproject file from Windows to Unix

查看:170
本文介绍了从Windows到Unix的Eclipse CDT .cproject文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个传统的内部工具,该工具可以从用于运行Simulink模拟的所有C文件中创建一个Eclipse CDT项目。我使用eclipse项目作为GDB的前端(在Windows中使用Cygwin)通过仿真C代码进行调试。该工具使用不变的 .cproject 文件制作项目。

I have a legacy, in-house tool that creates an Eclipse CDT project out of all the C files that I use to run Simulink simulations. I use the eclipse project as front end to GDB (in Windows using Cygwin) to debug by simulation C code. The tool uses an unchanging .cproject file to make the projects.

我现在在Unix上运行我的模拟,因此我试图移植该工具以在Unix中创建Eclipse项目。我一直在考虑如何将Windows .cproject 文件转换为Unix .cproject 文件。例如,在Unix Eclipse项目构建中,出现如下错误:

I am now running my simulations on Unix so I'm trying to port the tool to create an Eclipse project in Unix. I am stuck on how to turn my Windows .cproject file into a Unix .cproject file. For example in Unix Eclipse project build is giving me errors like below:

Managed Build system manifest file error: Option cdt.managedbuild.option.gnu.cross.path.2110017774 
uses a null category that is invalid in its context. The option was ignored.

我想这是由 .cproject造成的。文件,因为它是工具中唯一具有 cdt.managedbuild 的文件。

I am guessing that this is being caused by the .cproject file since it is the only file in the tool that has cdt.managedbuild in it.

<option id="cdt.managedbuild.option.gnu.cross.path.2110017774" 
superClass="cdt.managedbuild.option.gnu.cross.path" value="MinGWPath" valueType="string"/>

我什至不知道该文件在做什么或最初是如何生成的。我没有创建该工具,并且我是Eclipse新手。有什么资源可以用来了解如何创建,修改和解释.cproject文件?

I don't even understand what this file is doing or how it was generated in the first place. I did not create the tool and I am an Eclipse novice. Are there any resources that I could use to understand how to create, modify, and interpret a .cproject file?

推荐答案

.cproject 文件并非真正由以下人员生成外部工具。它们的确切格式没有记录,而是被视为实现细节。

.cproject files aren't really designed to be generated by external tools. Their exact format is not documented, and is considered to be an implementation detail.

Eclipse生态系统中的可扩展性和自动化旨在通过Eclipse插件实现。 Eclipse插件可以访问一组稳定的,有文档记录的API,可用于操作Eclipse工作区。例如,对于创建项目,您可以使用 IWorkspaceRoot.getProject() IProject.create() CoreModel.create(IProject) 。这些API的实现将处理诸如创建 .cproject 文件之类的细节。

Extensibility and automation in the Eclipse ecosystem is intended to happen through Eclipse plugins. Eclipse plugins have access to a set of stable, documented APIs which can be used to manipulate an Eclipse workspace. For example, for creating a project you might use APIs like IWorkspaceRoot.getProject(), IProject.create(), and CoreModel.create(IProject). The implementation of these APIs will take care of details such as creating the .cproject file.

如果您确实想要要自己生成 .cproject 文件,最好的方法是参考 CDT源代码了解其确切格式的详细信息,并在 CDT邮件列表。查看其他创建 .cproject 文件的跨平台工具的源代码也可能会有所帮助,例如 CMake ,它具有Eclipse项目生成器。

If you really want to generate the .cproject file yourself, your best bet is to refer to the CDT source code for details about its exact format, and ask any clarifying questions on the CDT mailing list. It may also be helpful to look at the source code of other cross-platform tools that create .cproject files, such as CMake which has an Eclipse project generator.

这篇关于从Windows到Unix的Eclipse CDT .cproject文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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