Re: Newbie making a dumb mistake but can you help?



Given what David says, I'd guess that RANDOMS and t_main are in separate
files, and that the link script (or whatever creates the link script)
doesn't contain a reference to the file that RANDOMS is in.

Try compiling and linking the source in one file, i.e. exactly as you have
shown it in your posting.

If you tell us what compiler and opsys you are using we will be able to make
more informed guesses.

--
Qolin

Email: my qname at domain
Domain: qomputing dot demon dot co dot uk
"JustMe2" <do_mail@xxxxxxx> wrote in message
news:1146084050.446725.56680@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am very new to fortran and I am (trying to) writing with fortran 90.
I have a very large project in front of me an want to use modules to
help organize the project.

I can write and compile the .mod files I can write, compile, link and
run "normal" .f90 files

Now I need to get the "use module" to work. I have a simple main that
reads the input and sets two vars. I then try to call a .mod function.

seemed simple but I cannot get the main to compile. I get an error
undefined reference to "___randoms_randie" randoms is the .mod file
randie is the function in the .mod file.

do I need to proto type? if so how do I do that, every place I put the
interface I get the error duplicate identifiers

Thank you in advance ...


==================================================

!**********************************************************************
MODULE RANDOMS
IMPLICIT NONE
CONTAINS
FUNCTION RANDIE(IX,RX)
REAL :: RANDIE
REAL, INTENT( IN ) :: IX, RX
REAL :: NIX, RI, II
RI = RX
II = IX
13 II=II*1029
NIX=IX/1048576
II=II-NIX*1048576
RI=II/1048575.7
IF(II.EQ.0)THEN
II=1
GO TO 13
END IF
RANDIE = RI
END FUNCTION RANDIE
END MODULE RANDOMS

==================================================
PROGRAM t_main
USE randoms
IMPLICIT NONE
REAL :: a, b, c

PRINT*, " enter a , b"
READ*, a,b
c = b
c = RANDIE(a,c)
PRINT*, " your input was ",a," and ",b," with a rondom number of ",c
PRINT*, " "

end PROGRAM t_main
===================================================



.