简体   繁体   English

Eclipse交叉编译......我该怎么做?

[英]Eclipse cross-compile… how can I do that?

I am developing on a Windows machine using Eclipse in C code. 我在使用Eclipse的C代码的Windows机器上开发。 All the files are physically located on a Linux server. 所有文件都物理上位于Linux服务器上。 I am using Eclipse only for editing and code browsing. 我只使用Eclipse进行编辑和代码浏览。 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. 当我想编译时,我打开一个终端并telnet到Linux服务器,我从中调用一个文件来设置一些变量并最终调用“make”命令。

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? 服务器非常繁忙..我希望能够在本地编译[然后将这些可执行文件ftp返回到Linux机器,以便我可以执行它们......除非Eclipse可以自己完成:)]。 ......任何想法怎么能这样做? 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... 我不熟悉Eclipse或操作系统的使用......所以如果你能回答并解释我应该做什么......我真的很感激......

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... 我收到此错误,如果我使用默认的“make”(无法运行程序“make”:启动失败)....获取(无法运行程序“T:\\ compile”:启动失败)如果我尝试调用我的我用来编译的脚本文件...

thanks, 谢谢,

You should take a look at running a crosstool-ng setup on your windows box inside cygwin . 你应该看看在cygwin里面的windows box上运行一个crosstool-ng设置。 And then have eclipse use that compiler. 然后让eclipse使用该编译器。 This will allow you to develop for your target Linux platform easily. 这将允许您轻松地为目标Linux平台进行开发。

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). 这听起来像是在为桌面/服务器平台开发,所以你必须确保使用与服务器相同版本的标准库设置crosstool-ng(libc,libstdc ++等)。 You also want to make sure your crosstool-ng has the same version of gcc as the target as well. 您还需要确保您的crosstool-ng具有与目标相同的gcc版本。

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. 如果你不想搞砸所有的设置,你总是可以在你的Windows机器上安装Linux作为虚拟机并在那里工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM