在Linux上安装mingw [英] mingw installation on Linux

查看:1029
本文介绍了在Linux上安装mingw的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试在Linux操作系统上编译Windows应用程序。我需要mingw来做到这一点。我读到Debian附带了已经安装的mingw软件包。当我运行shell命令时:

I'm currently trying to compile Windows applications on a Linux OS. I need mingw to do this. I read that Debian comes with mingw package already installed. When I run the shell command:

apt-cache search mingw

我得到一个输出:

binutils-mingw-w64 - Cross-binutils for Win32 and Win64 using MinGW-w64
binutils-mingw-w64-i686 - Cross-binutils for Win32 (x86) using MinGW-w64
binutils-mingw-w64-x86-64 - Cross-binutils for Win64 (x64) using MinGW-w64
g++-mingw-w64 - GNU C++ compiler for MinGW-w64
g++-mingw-w64-i686 - GNU C++ compiler for MinGW-w64 targeting Win32
g++-mingw-w64-x86-64 - GNU C++ compiler for MinGW-w64 targeting Win64
gcc-mingw-w64 - GNU C compiler for MinGW-w64
gcc-mingw-w64-base - GNU Compiler Collection for MinGW-w64 (base package)
gcc-mingw-w64-i686 - GNU C compiler for MinGW-w64 targeting Win32
gcc-mingw-w64-x86-64 - GNU C compiler for MinGW-w64 targeting Win64
gcc-mingw32 - GNU Compiler Collection for MinGW32 (transition package)
gfortran-mingw-w64 - GNU Fortran compiler for MinGW-w64
gfortran-mingw-w64-i686 - GNU Fortran compiler for MinGW-w64 targeting Win32
gfortran-mingw-w64-x86-64 - GNU Fortran compiler for MinGW-w64 targeting Win64
gnat-mingw-w64 - GNU Ada compiler for MinGW-w64
gnat-mingw-w64-i686 - GNU Ada compiler for MinGW-w64 targeting Win32
gnat-mingw-w64-x86-64 - GNU Ada compiler for MinGW-w64 targeting Win64
gobjc++-mingw-w64 - GNU Objective-C++ compiler for MinGW-w64
gobjc++-mingw-w64-i686 - GNU Objective-C++ compiler for MinGW-w64 targeting Win32
gobjc++-mingw-w64-x86-64 - GNU Objective-C++ compiler for MinGW-w64 targeting Win64
gobjc-mingw-w64 - GNU Objective-C compiler for MinGW-w64
gobjc-mingw-w64-i686 - GNU Objective-C compiler for MinGW-w64 targeting Win32
gobjc-mingw-w64-x86-64 - GNU Objective-C compiler for MinGW-w64 targeting Win64
gdb-mingw-w64 - Cross-debugger for Win32 and Win64 using MinGW-w64
gdb-mingw-w64-target - Cross-debugger server for Win32 and Win64 using MinGW-w64
libconfig++-dbg - parsing and manipulation of structured config files(C++ debug symbols)
libconfig++-dev - parsing and manipulation of structured config files(C++ development)
libconfig++9 - parsing and manipulation of structured configuration files(C++ binding)
libconfig-dbg - parsing and manipulation of structured config files(debug symbols)
libconfig-dev - parsing and manipulation of structured config files(development)
libconfig-doc - parsing and manipulation of structured config files(Documentation)
libconfig9 - parsing and manipulation of structured configuration files
mingw-ocaml - OCaml cross-compiler based on mingw
mingw32-ocaml - OCaml cross-compiler based on mingw -- dummy transitional package
mingw-w64 - Development environment targetting 32- and 64-bit Windows
mingw-w64-dev - Development files for MinGW-w64 (transitional package)
mingw-w64-i686-dev - Development files for MinGW-w64 targeting Win32
mingw-w64-tools - Development tools for 32- and 64-bit Windows
mingw-w64-x86-64-dev - Development files for MinGW-w64 targeting Win64
mingw32 - Minimalist GNU win32 (cross) compiler
mingw32-binutils - Minimalist GNU win32 (cross) binutils
mingw32-runtime - Minimalist GNU win32 (cross) runtime

当我检查i686-w64-mingw32的/ usr / bin /和/ usr / lib时,在任何地方都找不到它。

When I check the /usr/bin/ and /usr/lib for i686-w64-mingw32 I can't find it anywhere.

我've还找到了一个搜索,用find -name mingw 唱了运气。

I've also find a search sing find -name "mingw" without much luck.

Debian是mingw附带的,还是我必须安装它?如果mingw附带了它,我该如何使用它?

Does Debian come with mingw or do I have to install it? If it does come with mingw how do I use it?

推荐答案

用wine64安装工具链(用于运行Windows可执行文件):

Install the toolchain with wine64 (for running Windows executables):

sudo apt-get install gcc-mingw-w64-x86-64 g ++-mingw-w64-x86-64 wine64

编译:

x86_64-w64-mingw32-gcc -o您好。 exe hello.c

检查结果:

文件hello.exe

运行:

wine64 ./hello.exe

还有 gdb-mingw-w64 提供 / usr / bin / x86_64-w64-mingw32-gdb ,但是我不知道它是如何工作的(当我尝试显示时不知道如何运行。尝试帮助目标。)。

There is also gdb-mingw-w64 providing /usr/bin/x86_64-w64-mingw32-gdb but I could not figure out how it works (when I try it says Don't know how to run. Try "help target".).

这篇关于在Linux上安装mingw的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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