|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Anonymous Guest
|
Posted: Sun Jan 30, 2005 11:36 am Post subject: Using modules, newbie question |
|
|
I've just started with Fortran and I can't get my project to work with modules. I'm using the version 4.71 personal FTN95.
This is a simple test program I made
I made a file called main.f95 and added it to "source files" for the project
Code: | PROGRAM MAIN
USE MOD1
WRITE(*,*) PI
END PROGRAM |
Then I made a file called MOD1.f95 and added that as well to source files
Code: | MODULE MOD1
INTEGER :: PI = 3
END MODULE MOD1 |
When I later save the project, the main.f95 is put in "include files" and is no longer in source files. I don't understand that. When I try to compile the program by pressing start I get an error saying: "ERROR: The target does not exist" and the output says
"Compiling file: MOD1.f95
Linking...
*** No main, WinMain or LibMain function"
What should I do? It would probably work if the main.f95 would remain in "source files". |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Sun Jan 30, 2005 12:31 pm Post subject: Using modules, newbie question |
|
|
I think I solved the problem, because it seems to be working now. I moved the project folder from "c:My downloads_fortran" to only "c:sources" and now it doesn't move the main.f95 to "include files" anymore. Maybe FTN95 had a problem with the folder names. |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Sun Jan 30, 2005 12:58 pm Post subject: Using modules, newbie question |
|
|
Sorry, it was only working temporarily. It doesn't work any longer. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|