Eclipse交叉编译...我该怎么做? [英] Eclipse cross-compile... how can I do that?

查看:155
本文介绍了Eclipse交叉编译...我该怎么做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Eclipse的C代码在Windows机器上开发。
所有文件都位于Linux服务器上。
我只使用Eclipse进行编辑和代码浏览。
当我想编译时,我打开一个终端和telnet到Linux服务器,从中我调用一个设置几个变量的文件,最终调用一个make命令。



服务器非常忙碌..然后我希望能够本地编译[然后只需将这些可执行文件ftp恢复到Linux机器,以便我可以执行它们,除非Eclipse可以在其上执行自己:)] ....任何想法怎么可以做到?我不熟悉Eclipse或操作系统的使用....所以如果你可以回答和解释我应该做什么..我真的很感激...



我通过调用在通常调用来编译的服务器上的脚本文件,在项目属性菜单下更改了构建命令。这看起来很简单..好吧,这太好了,不能真的...当然..它没有工作!如果我使用默认的make(无法运行程序make:启动失败)....得到(无法运行程序T:\compile:启动失败),如果我尝试调用我的脚本文件,我用来编译...



谢谢,

解决方案

您应该看一下运行 crosstool-ng cygwin 内的Windows框上设置。然后让eclipse使用该编译器。这将允许您为目标Linux平台轻松开发。



这里有一些幻灯片



这听起来像是为桌面/服务器平台开发的,所以你必须确保您可以使用与服务器具有的相同版本的标准库(libc,libstdc ++等)来设置您的crosstool-ng。您还要确保您的交叉工具与目标版本的gcc版本相同。



如果您不想弄乱所有设置您可以随时将Windows作为虚拟机安装在Windows框上,然后在其中进行。


I am developing on a Windows machine using Eclipse in C code. All the files are physically located on a Linux server. I am using Eclipse only for editing and code browsing. When I want to compile, I open a terminal and telnet to the Linux server from which I call a file that sets up few variables and eventually invoke a "make" command.

The server is pretty busy.. I would then like to be able to compile locally [and then just ftp these executable files back to the Linux machine so that I can execute them.. unless Eclipse can do that on its own :) ].... any idea how can that be done? I am not well versed in Eclipse or OS usage.... so if you could answer and explain what I should do.. I would really appreciate...

I changed the Build Command under Project Properties menu by just calling the script file on the server I usually invoke to compile... That looked fairly simple.. well... that was too good to be true... and of course.. it didn't work! I am getting this error if I use the default "make" (Cannot run program "make": Launching failed).... while getting (Cannot run program "T:\compile": Launching failed) if I try to invoke my script file that I use to compile...

thanks,

解决方案

You should take a look at running a crosstool-ng setup on your windows box inside cygwin. And then have eclipse use that compiler. This will allow you to develop for your target Linux platform easily.

Here's some slides

It sounds like you're developing for a desktop/server platform, so you'll have to make sure you set up your crosstool-ng with the same versions of standard libs as your server has (libc, libstdc++, etc). You also want to make sure your crosstool-ng has the same version of gcc as the target as well.

If you don't want to mess with getting all that setup, you could always install Linux as a virtual machine on your windows box and work inside there.

这篇关于Eclipse交叉编译...我该怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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