Discussion:
gfortran for windows creating 32bit executables
Steve Verdier
2014-06-26 15:04:24 UTC
Permalink
Hi Guys,

I've searched the gfortran pages, but can't seem to find a compiler for Windows 7 that creates 32bit executables (which I need for interfacing with non-fortran 32bit programs).

Is there such an animal, or is there a compiler switch for the MinGW64 compiler I have downloaded ? This name "x86_64-4.9.0-win32-seh-rt_v3-rev2" seems to imply 32bit, but I'm getting a link error when linking a subroutine created with that into a 32bit main program.

Regards,
Steve Verdier
Please consider the environment before printing this e-mail.

Micro Focus Limited is registered in England and Wales. Registered number: 01504593 Registered office: The Lawn, 22-30 Old Bath Road Newbury, Berkshire, RG14 1QN, UK


This message has been scanned for malware by Websense. www.websense.com
Tim Prince
2014-06-26 15:34:21 UTC
Permalink
Post by Steve Verdier
I've searched the gfortran pages, but can't seem to find a compiler for Windows 7 that creates 32bit executables (which I need for interfacing with non-fortran 32bit programs).
Is there such an animal, or is there a compiler switch for the MinGW64 compiler I have downloaded ? This name "x86_64-4.9.0-win32-seh-rt_v3-rev2" seems to imply 32bit, but I'm getting a link error when linking a subroutine created with that into a 32bit main program.
Maybe there are more of those than you bargained for, but the cygwin
setup offers 32- and 64-bit mingw gfortran compilers, as well as 32- and
64-bit "cygwin native." Even if you had a driver like the linux one
supporting -m32 switch, 32-bit mode relies on actually having 32-bit
compilers and libraries installed.
As you found, you can't mix 32- and 64-bit objects and linkers.
--
Tim Prince
LMH
2014-06-26 16:03:20 UTC
Permalink
Post by Steve Verdier
Hi Guys,
I've searched the gfortran pages, but can't seem to find a compiler for Windows 7 that creates 32bit executables (which I need for interfacing with non-fortran 32bit programs).
Is there such an animal, or is there a compiler switch for the MinGW64 compiler I have downloaded ? This name "x86_64-4.9.0-win32-seh-rt_v3-rev2" seems to imply 32bit, but I'm getting a link error when linking a subroutine created with that into a 32bit main program.
Regards,
Steve Verdier
Please consider the environment before printing this e-mail.
Micro Focus Limited is registered in England and Wales. Registered number: 01504593 Registered office: The Lawn, 22-30 Old Bath Road Newbury, Berkshire, RG14 1QN, UK
This message has been scanned for malware by Websense. www.websense.com
Hello,

I use gcc in the cygwin tool kit (http://cygwin.com/). The cygwin tool
kit is available in both 32-bit,
http://cygwin.com/setup-x86.exe

and 64-bit,
http://cygwin.com/setup-x86_64.exe

Cygwin gives you a bash shell running in a mintty terminal. From there
you can run make with any of the gnu compilers you have installed using
the cygwin package manager. You can also run the other linux utilities
(sed, grep, awk, etc) along with interpreters (perl, python, ruby), and
allot of other stuff.

There are some additional steps in you make file to create apps that
will run on windows without cygwin installed. For gcc3 there was the
no-cygwin flag that you would add to your compile and build rules. That
flag was depreciated starting with gcc4, but I know there are other
methods. A bit of time with google should sort it out if someone from
gcc-help doesn't offer a suggestion.

LMH
David Gressett
2014-06-27 19:19:45 UTC
Permalink
Post by Steve Verdier
Hi Guys,
I've searched the gfortran pages, but can't seem to find a compiler for Windows 7 that creates 32bit executables (which I need for interfacing with non-fortran 32bit programs).
Is there such an animal, or is there a compiler switch for the MinGW64 compiler I have downloaded ? This name "x86_64-4.9.0-win32-seh-rt_v3-rev2" seems to imply 32bit, but I'm >getting a link error when linking a subroutine created with that into a 32bit main program.
Regards,
Steve Verdier
32-bit gfortran is available in the MinGW compilers:

http://sourceforge.net/projects/mingw/?source=directory

Loading...