如何在 Eclipse 中设置 linux C++ 项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/204345/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 13:21:23  来源:igfitidea点击:

How to setup a linux C++ project in Eclipse?

c++linuxeclipse

提问by simon

I have an existing C++ project on a linux environment, and would like to import it into the Eclipse IDE.

我在 linux 环境中有一个现有的 C++ 项目,并且想将它导入到 Eclipse IDE 中。

Not sure if I should start a new Eclipse C++ project, or if there was some way to import the source files?

不确定我是否应该开始一个新的 Eclipse C++ 项目,或者是否有某种方法可以导入源文件?

采纳答案by JesperE

You can create a new Eclipse C++ project "in-place", i.e. if you have your sources checked out at /home/joe/mysources, you can select that directory in the new project wizard (uncheck the "use default location" checkbox first). All your source files will show up in the Eclipse project.

您可以“就地”创建一个新的 Eclipse C++ 项目,即如果您在 /home/joe/mysources 中签出您的源代码,您可以在新项目向导中选择该目录(首先取消选中“使用默认位置”复选框)。您的所有源文件都将显示在 Eclipse 项目中。

回答by PW.

one solution: just create a new C++ projet (Standard make project), checkout/copy your files in it, then right clic on the directory of the project in the ressource view and choose New > Other > C++ > Convert to C/C++ Make project.

一种解决方案:只需创建一个新的 C++ 项目(标准 make 项目),检出/复制其中的文件,然后在资源视图中右键单击项目目录,然后选择新建 > 其他 > C++ > 转换为 C/C++ 制作项目。