This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC/Linux to produce exe files for Windows


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]