Fortran Free Program for Compiling Windows Executables from Fortran77 Files

AI Thread Summary
A user seeks a free program to compile Fortran77 files into Windows executables, specifically needing to link subroutines with a resource file and a library. They have experience with gfortran and have installed it, but face challenges with linking a Windows library file (.lib) and converting a resource file (.res) to an object file. The user has successfully compiled some code but encounters issues with the application freezing and the resource dialog not appearing. They are considering whether to use different library files or if the renamed library file is causing the problem. The discussion highlights the complexities of compiling and linking in a Windows environment using gfortran.
Ambrus
Messages
4
Reaction score
0
Hi!

I would like to compile some *.for files (only standard Fortran77 statements) which only contains some subroutines and functions and link them with a *.res resource file and a *.lib library file (supplied by developers) into a windows executable.


Is there any FREE program to achieve this?



Some detail:
-My operating system is Windows7
-Previously I used the the trial version of an Intel program and it worked.
-The *.exe I'm trying to recreate meant to be a modified version of an existing windows program, so that's why I need the *.res and the *.lib files.

Thans for the answer!
 
Technology news on Phys.org
Did you look up the gfortran compiler?
 
No, not yet.
Do you have experience with compiling windows executables in gfortran?
 
Well, I somtimes used gfortran under cygwin. There are also binary builds of the compiler around for windows, so it should be easy to try them out.
 
I installed gfortran and tried it on some small programs.
Now I would like to link my library file, and resouce file with my object files.
So about the library:
It only accepts files with a name like: libfilename.a (like in unix) and I have a filename.lib (windows). Is changeing the filename enough, or should i convert it somehow?
About the .res file:
On other forums they told me I should convert my filename.res into a filename.rc file, then with windres.exe convert that into an object file.
Do you think that could work?
 
So I'm using gfortran:
-compile with gfortran.exe with the -c option to prooduce .o files
-convert the .res resource file into an object file (.o) with res2coff.exe
-use ld.exe to link the object files mentioned above and MY library file, and some other library files too provided by gfortran

Now I can produce a windows application, but it needs some .dll in the same directory. So I put them together but it freezes when I try to run it, and the dialog from the resource file doesn't appear at all.

Should I use other library files?
Is MY renamed library file the one which causes the problem?
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Back
Top