Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie can't compile his program :-(

Status
Not open for further replies.

DanSandbergUCONN

Programmer
Jun 13, 2007
14
US
Hi all - I'm an intermediate programmer in many langauges but I'm just beginning to explore Fortran. My goal is to take a Fortran source code written on a PC and recompile it in a Mac to make a mac-compatible version of the program.

Before I even get into the issue with all that, I'm starting with the ABC basics and trying to write the typical "Hello World" program. I am using Absoft Pro Fortran 90/95 as a compiler and they have example programs to practice compilation. I select create a new MRWE file and then I have added their pre-written "Hello_ex.f95" function to my list of files and then added the following code to the main function:

Program hello
call Hello_ex()
stop
End Program hello

All this was outlined in the User Guide pdf. I compile the program and get a message that compilation was sucessful. However, when I execute the program in Absoft a message comes up that says, "Program finished and returned code 0". If I double-click the application I created then a window opens and closes instantly and that's it. What am I doing wrong? How do I fix this?
 
Hi Dan,

You'll want to ask this in another forum. This forum is a forum about using object oriented techniques in software architecture. I believe there is a fortran forum somewhere.

Bob
 
Dan

Double clicking an .exe (on Windows, at least) opens a command window, runs the prog, and closes the window immediately afterwards, typically before you have a chance to see the output. Most people put a dummy read from user input at the end just to hold the window open. To check if this is your problem, open a command window yourself, CD to the right directory, and run the program from the command line.

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top