用于远程构建的 Eclipse CDT 设置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1824850/
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 14:11:06  来源:igfitidea点击:

Eclipse CDT setup for remote build

eclipseeclipse-cdt

提问by Posco Grubb

Is there a better way to setup Eclipse CDT for local editing and remote building?

有没有更好的方法来设置 Eclipse CDT 以进行本地编辑和远程构建?

I am working on a C++ project that uses GNU make in Linux. The code is under CVS on a Linux server.

我正在开发一个在 Linux 中使用 GNU make 的 C++ 项目。该代码位于 Linux 服务器上的 CVS 下。

When I'm in the lab, I use Eclipse CDT on a Linux-x64 PC. The project is built on a Linux-x86 PC. All the computers in the lab (including the CVS server) have NFS mounts.

当我在实验室时,我在 Linux-x64 PC 上使用 Eclipse CDT。该项目建立在 Linux-x86 PC 上。实验室中的所有计算机(包括 CVS 服务器)都安装了 NFS。

When I'm at home, I use Eclipse CDT on a Windows 7 PC. The Windows PC connects to the Linux CVS server via SSH tunnel. To edit source, I rsync the C++ project under the Linux Eclipse workspace back to my Windows Eclipse workspace. (I can also do a remote CVS checkout on the Windows PC.) To build from home, I use a custom build command that

当我在家时,我在 Windows 7 PC 上使用 Eclipse CDT。Windows PC 通过 SSH 隧道连接到 Linux CVS 服务器。为了编辑源代码,我将 Linux Eclipse 工作区下的 C++ 项目同步回我的 Windows Eclipse 工作区。(我也可以在 Windows PC 上进行远程 CVS 检出。)要在家构建,我使用自定义构建命令

  1. SSH's to the Linux-x86 PC,
  2. rsync's the C++ project from my Windows Eclipse workspace to my Linux Eclipse workspace,
  3. and then runs make on the Liunx-x86 PC, specifying the correct path for the Makefile.
  1. SSH 连接到 Linux-x86 PC,
  2. rsync 是从我的 Windows Eclipse 工作区到我的 Linux Eclipse 工作区的 C++ 项目,
  3. 然后在 Liunx-x86 PC 上运行 make,指定 Makefile 的正确路径。

In order to go back and forth between lab and home without committing my changes to CVS every time, I use rsync. When I transition from lab to home, I rsync sources to my Windows Eclipse workspace. When I build from home, the sources get rsync'd back to the Linux Eclipse workspace.

为了在实验室和家之间来回切换而不每次都提交我对 CVS 的更改,我使用了 rsync。当我从实验室过渡到家时,我将源文件同步到我的 Windows Eclipse 工作区。当我在家中构建时,源会被 rsync 同步回 Linux Eclipse 工作区。

Is there a better, less wonky way to do this?

有没有更好的,不那么不稳定的方法来做到这一点?

(I'm NOT interested in remote debugging.)

(我对远程调试不感兴趣。)

回答by GrkEngineer

Netbeans has good support for this. I've tried to get it working in Eclipse, but Netbeans was much easier with built in support.

Netbeans 对此有很好的支持。我试图让它在 Eclipse 中工作,但 Netbeans 有了内置支持就容易多了。

回答by txs

I need to do similar things, and I took a look at Synchronized Projects: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.doc.user%2Fhtml%2FlocalVsRemote.html

我需要做类似的事情,我看了一下同步项目:http: //help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.doc.user%2Fhtml%2FlocalVsRemote.html

Synchronized projects support multiple build configurations, so the build can happen either locally or on one or more remote systems. The user can select which system will be used to build the project. A launch configuration can then be created to to run the application on the target machine.

同步项目支持多种构建配置,因此构建可以在本地进行,也可以在一个或多个远程系统上进行。用户可以选择使用哪个系统来构建项目。然后可以创建启动配置以在目标机器上运行应用程序。

To build on remote machine, follow Working with a Synchronized Project: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.doc.user%2Fhtml%2Fsync.html

要在远程机器上构建,请遵循使用同步项目:http: //help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ptp.doc.user%2Fhtml%2Fsync.html

回答by Dov

How about using vnc and remotely logging in, using eclipse ON your unix box in the lab? The only thing to go across the link is your editing, and vnc is pretty efficient about that.

如何使用 vnc 和远程登录,在实验室的 unix 机器上使用 eclipse?唯一需要通过链接的是您的编辑,而 vnc 对此非常有效。

回答by MadHatter

This post seems quite old. But in case this might help somebody, I'd like to post a solution that works both on Linux and windows machines, which is really easy.

这个帖子好像很老了。但是,如果这可能对某人有所帮助,我想发布一个适用于 Linux 和 Windows 机器的解决方案,这真的很容易。

Now there is an Eclipse parallel version and you can just install that and change few lines in your remote machine's bash_profile to load few git functions. I'm even connecting from behind a gateway which is a little tricky. It is easier without. See this link: http://umayanganie.blogspot.com/2017/05/build-debug-cc-projects-via-remote.html

现在有一个 Eclipse 并行版本,您可以安装它并更改远程机器的 bash_profile 中的几行以加载一些 git 函数。我什至从网关后面连接,这有点棘手。没有它更容易。请参阅此链接: http://umayanganie.blogspot.com/2017/05/build-debug-cc-projects-via-remote.htm

回答by Kos

One solution is to use Eclipse RSE (Remote System Explorer). It allows to "mount" a remote subfolder directly into the workspace (via FTP or SSH). CDT has some issues with the virtual file system used by RSE, but it ... well, more or less works.

一种解决方案是使用Eclipse RSE (Remote System Explorer)。它允许将远程子文件夹直接“挂载”到工作区(通过 FTP 或 SSH)。CDT 对 RSE 使用的虚拟文件系统存在一些问题,但它......好吧,或多或少是有效的。

There's some discussion on that on my question:

关于我的问题有一些讨论:

Work on a remote project with Eclipse via SSH

通过 SSH 使用 Eclipse 处理远程项目