如何在Eclipse中的远程计算机上构建一个c ++项目? [英] How to build a c++ project on a remote computer in Eclipse?

查看:150
本文介绍了如何在Eclipse中的远程计算机上构建一个c ++项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台安装了Eclipse Ganymede的Windows PC,以及一个我的C ++项目文件所在的Linux pc。我使用Eclipse通过SMB编辑文件,并希望使用Eclipse构建项目。
目前我使用putty连接到我的linux机器,并从相应的目录运行./make。我将如何在Eclipse中运行相同的命令并查看其中的结果?我已经安装了RSE插件,但仍然无法掌握如何做到这一点。



只是为了使自己清楚 - 我可以使用VNC来安装已经安装的Eclipse在我的linux机器上,但我宁愿不这样做。 Eclipse通过VNC缓慢而不像Eclipse安装在我的Windows机器上那么敏感。



谢谢,
Rouli

解决方案

我处于类似的情况,在Windows工作站中开发,在linux服务器中进行编译。这是我结束的:


  1. 使用putty设置无密码登录到编译器服务器,例如您可以按照教程

  2. 创建一个登录使用putty进行会话,确保在Connections / SSH / Auth中指向您的私钥。

  3. 将eclipse make命令修改为 plink.exe -loadsaved_session make -C / remote / path / project (此设置在Project / Properties / C ++ Build / Builder设置/构建命令中)。如果您必须传递更多参数和/或您的设置更复杂,则可以使用批处理/ shell文件自动执行此操作。

如果您已经使用私钥存储密码,那么您可以使用pageant.exe将密钥加载一次,因此您不必每次输入密码。


I have a Windows pc with Eclipse Ganymede installed, and a Linux pc where my C++ project files are located. I use Eclipse to edit the files through SMB, and would like to build the project using Eclipse as well. Currently I connect using putty to my linux machine, and run ./make from the appropriate directory. How would I run the same command within Eclipse and see the results in it? I have installed the RSE plugin, but still can't grasp how to do so.

Just to made myself clear - I can use VNC to work on Eclipse that is installed on my linux machine, but I prefer not do so. Eclipse through VNC is slow and not as responsive as the Eclipse installed on my windows machine.

Thanks, Rouli

解决方案

I was in a similar situation, developing in a windows workstation, compiling in a linux server. This is what I ended doing:

  1. Setup a passwordless login to the compiler server with putty, for example you can follow this tutorial.
  2. Create a login session with putty, make sure that in Connections/SSH/Auth is pointing to your private key.
  3. Modify eclipse make command to plink.exe -load "saved_session" make -C /remote/path/project (This setting is in Project/Properties/C++Build/Builder Settings/Build command). You can automate this with a batch/shell file if you have to pass more parameters and/or your setup is more complex.

If you have stored a passphrase with your private key then you can use pageant.exe to load your key only once, so you dont have to type your passphrase every time.

这篇关于如何在Eclipse中的远程计算机上构建一个c ++项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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