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

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

Eclipse cross-compile... how can I do that?

cwindowslinuxeclipsecross-compiling

提问by user112754

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.

我正在 Windows 机器上使用 C 代码中的 Eclipse 进行开发。所有文件都位于 Linux 服务器上。我仅将 Eclipse 用于编辑和代码浏览。当我想编译时,我打开一个终端并 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? 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...

服务器很忙..然后我希望能够在本地编译[然后只需将这些可执行文件ftp回Linux机器,以便我可以执行它们..除非Eclipse可以自己完成:)]。 ......知道怎么做吗?我不太精通 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”:启动失败),我会收到此错误。我用来编译的脚本文件...

thanks,

谢谢,

回答by Steve Lazaridis

You should take a look at running a crosstool-ngsetup 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.

您应该看看在cygwin内的 Windows 框中运行crosstool-ng设置。然后让 Eclipse 使用该编译器。这将使您能够轻松地针对您的目标 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). You also want to make sure your crosstool-ng has the same version of gcc as the target as well.

听起来您正在为桌面/服务器平台开发,因此您必须确保使用与服务器相同版本的标准库(libc、libstdc++ 等)来设置 crosstool-ng。您还想确保您的 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.

如果您不想搞砸所有这些设置,您可以随时将 Linux 作为虚拟机安装在您的 Windows 机器上并在其中工作。