Silverfrost Forums

Welcome to our forums

Some error messages

14 Nov 2012 8:35 #11043

Hi, I am totally new in the FORTRAN world and therefore understanding this language together with some warnings and error messages becomes harder and harder. I tried to find the meaning of different errors, but was not successful enough. After starting the compiling, I got the only red-error message as '*** No main program supplied' and the compilation failed without showing any result.

What should I do? what is the problem?

14 Nov 2012 8:51 #11044

You need one and only one main program.

Here is a template for a working program

! External subroutine, not in a module
SUBROUTINE AAA()
END SUBROUTINE AAA

! Module with subroutine
MODULE XXX
CONTAINS
   SUBROUTINE BBB
   END SUBROUTINE BBB
END MODULE XXX

! Main program
PROGRAM NNN
   USE XXX, ONLY: BBB
   CALL AAA
   CALL BBB
END PROGRAM NNN
14 Nov 2012 9:13 #11047

Thanks, but the point is that I need just to write one subroutine. I am going to use it later in another software. I mean to say that, I do not have any program. It is just one subroutine and thats all. Does FTN95 compile just one subroutine without any program?

14 Nov 2012 10:38 #11049

I see.

Are you using Plato, FTN95 Express (the free Visual studio Shell plug in), or the command line?

In Plato Build>Compile or Control-F7 compiles without trying to link to create a program. This will produce a .OBJ file that can be linked to your program later.

Are you going to supply your subroutine as source code for the other software? If so this is all you need to do to check it will compile. However, you may want to write a simple main program which calls the subroutine so you can test it.

14 Nov 2012 12:26 #11052

Thanks david 😃 good idea 😃

Please login to reply.