C ++交叉编译器从Windows到Linux [英] C++ cross-compiler from Windows to Linux

查看:252
本文介绍了C ++交叉编译器从Windows到Linux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可能会推荐我从Windows到Linux的C ++交叉编译器以及如何使用它吗?

Can someone recommend me a C++ cross-compiler from Windows to Linux and how to use it?

我真的是说如何使用它,因为虽然我编程了一段时间现在我仍然是一个Windows用户,我习惯了下一步 - >下一步 - > Voila,一个白痴证明( F5 )调试/ test在Visual Studio中,我讨厌所有需要一吨配置的东西,只是为了写Hello。

By that I really mean "how to use it", because although I'm programming for a bit of time now I'm still a Windows user and I'm used to Next --> Next--> Voila, an idiot proof play (F5) for debug/testing in Visual Studio, and I hate all the stuff that needs a tonne of configuration just to write "Hello".

推荐答案

crosstool-ng支持使用cygwin主机构建交叉编译器

概述:


  • 使用开发包安装cygwin

  • 下载 crosstool-ng

  • 解压缩档( tar xvjf crosstool-ng *

  • 运行 ./ configure

  • 当配置提示缺少工具时,回到cygwin安装程序并安装相应的包 flex libtool ncurses-devel 需要至少以下:


    • Devel / gperf

    • Devel / bison

    • Devel / byacc

    • Devel / wget

    • Devel / patch


    • Devel / automake 1.10 +

    • Libs / libncursesw10

    • Libs / libncursesw10-devel

    • Install cygwin, with development packages
    • Download crosstool-ng
    • Extract the tarball (tar xvjf crosstool-ng*)
    • Run ./configure
    • When configure complains about a missing tool, go back to cygwin setup and install the corresponding package (e.g. flex, libtool, ncurses-devel) You'll need at least the following:
      • Devel/gperf
      • Devel/bison
      • Devel/byacc
      • Devel/wget
      • Devel/patch
      • Devel/make (GNU version)
      • Devel/automake 1.10+
      • Libs/libncursesw10
      • Libs/libncursesw10-devel
      • the _libintl_gettext error as mentioned in the comments
      • the byteshift headers, and
      • the ELF headers (Thanks Duncan Calvert & osm0sis)

      当然,这不会让你从Visual Studio内部构建linux应用程序。 (VS2010和以后让您使用其他工具链如gcc构建,但除了由crosstool-ng构建的交叉编译器之外,您还需要一个适当的工具链描述。但你会有一个工作 g ++ - linux-gnu ,你可以直接运行或使用Makefile。

      Of course, this is NOT going to enable you to build linux applications from inside Visual Studio. (VS2010 and later let you build with other toolchains such as gcc, but you'd need an appropriate toolchain description in addition to the cross-compiler built by crosstool-ng). But you'll have a working g++-linux-gnu, which you can either run directly or using a Makefile.

      注意:构建交叉编译器需要长时间。 osm0sis已提供预建的gcc 4.8.1此处,以及他的关于构建交叉编译器的注释(用于更新此答案)。

      NOTE: Building the cross-compiler takes a LONG time. osm0sis has provided a prebuilt gcc 4.8.1 here, along with his notes on building the cross-compiler (used to update this answer).

      这篇关于C ++交叉编译器从Windows到Linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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