View previous topic :: View next topic |
Author |
Message |
DonaldLopez
Joined: 12 Nov 2014 Posts: 1
|
Posted: Thu Nov 13, 2014 9:29 pm Post subject: Problems with FUNCTON |
|
|
Hi i need help, when i make a subroutine function it does not work whit my main program and the error showed is the next:
1.- when i compiling the main show:
Compiling and linking file: YinaPrinc.f95
WARNING the following symbols are missing:
MROOTTDAP C:\Users\Dell\Documents\Donald\Programas fortran\Programa Yina\lgotemp@.obj
(C:\USERS\DELL\DOCUMENTS\DONALD\PROGRAMAS FORTRAN\PROGRAMA YINA\YINAPRINC.F95)
Creating executable: C:\Users\Dell\Documents\Donald\Programas fortran\Programa Yina\YinaPrinc.EXE
Compilation and linking completed.
2 when i compiling the function:
Compiling and linking file: AREA.f95
*** No main, WinMain or LibMain function
*** Compilation abandoned
Compilation failed.
i dont now what i need do it to run. |
|
Back to top |
|
|
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Fri Nov 14, 2014 12:59 pm Post subject: |
|
|
Hard to tell without seeing the code. Could be anything.
Are you using modules?
If not, have you declared your function's type in the main program?
e.g. if the function is REAL you need the following in your main program.
REAL MROOTTDAP
If this doesn't help can you post some code. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Mon Dec 01, 2014 12:20 am Post subject: |
|
|
Donald,
It looks to me that your main program routine is in the first file, and the missing subroutine is in the second file.
If you are compiling by issuing the commands manually, then you need to compile them without linking, i.e. using the token -c (for compile only):
Code: | FTN95 -c YinaPrinc
FTN95 -c Area |
and then link with SLINK, as in:
Code: | SLINK YinaPrinc.obj Area.obj Yina |
(Would create Yina.exe)
If you are using Plato, then you have to include both source code files in your project.
I think from what you posted you are trying to compile AND link each file separately.
Eddie |
|
Back to top |
|
|
|