如何使用交叉编译器i686-w64-mingw32-gcc指定win32或Windows 64目标

时间:2021-12-29 20:21:11

I have recently downloaded the mingw-w64 package under Fedora Linux in order to be able to cross compile targetting both win32 and "Windows 64". But I fail to understand how to specify what target I want to use. What flags do I need to supply to gcc and to the linker in order to choose my target architecture?

我最近在Fedora Linux下下载了mingw-w64软件包,以便能够交叉编译目标win32和“Windows 64”。但我不明白如何指定我想要使用的目标。为了选择目标架构,我需要向gcc和链接器提供哪些标志?

1 个解决方案

#1


6  

W32 and W64 are two different architectures, so you distinguish by compiler name. The debian mingw-w64 calls them i686-w64-mingw32-gcc for Win32 and x86_64-w64-mingw32-gcc for Win64.

W32和W64是两种不同的体系结构,因此您可以通过编译器名称进行区分。 debian mingw-w64称其为Win32的i686-w64-mingw32-gcc和Win64的x86_64-w64-mingw32-gcc。

#1


6  

W32 and W64 are two different architectures, so you distinguish by compiler name. The debian mingw-w64 calls them i686-w64-mingw32-gcc for Win32 and x86_64-w64-mingw32-gcc for Win64.

W32和W64是两种不同的体系结构,因此您可以通过编译器名称进行区分。 debian mingw-w64称其为Win32的i686-w64-mingw32-gcc和Win64的x86_64-w64-mingw32-gcc。