Re: GCC/Linux to produce exe files for Windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Enrico Migliore wrote:

>  In the mean time, though, I would like to build the program on Linux
>  and configure GCC to produce an .exe for Windows.
>  As said, the program doesn't call any Windows API, therefore, I hope,
>  it should be a matter of choosing the right GCC options, right?

What you will be building will be a cross compiler, using either the
mingw runtime or the cygwin runtime.  The resulting .exe will be
precisely identical to the .exe you would get from running a native gcc
of the same flavor under Windows, so if your goal is to fix some kind of
problem then doing this will have no affect whatsoever.  Cross compilers
are about developer convenience of not having to reboot to another
operating system or log on to another system, and the whole point is
that the binaries generated for a given target are precisely identical
regardless of the host operating system.

There is no such thing as "just produce an .exe" in a vacuum, there is
always some form of an underlying system C runtime library that the
compiler must use (i.e. have headers and libraries installed), and in
the case of gcc your main choices are mingw or cygwin.

Brian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux