Topic: Problem with modules
I'm new to modern Fortran, and to Simply Fortran, which I downloaded a few days ago. Here's my problem. I built the following module:
integer, parameter, dimension(12) :: days_per_month = [31,28,31,30,31,30,31,31,30,31,30,31]
character(len = 9), parameter, dimension(12) :: month_names = [character(len=9) :: 'January','February','March','April','May',&
The following program compiles and runs:
but this program won't even compile:
integer :: i
do i = 1,12
The error message that I get is:
build\testmain.o:testmain.f90:(.rdata$.refptr.__months_MOD_days_per_month[.refptr.__months_MOD_days_per_month]+0x0): undefined reference to `__months_MOD_days_per_month'
collect2.exe: error: ld returned 1 exit status
Error: Last command making (target.exe) returned a bad status
Error: Make execution terminated
* Failed *
The file is saved as test.f90, and I did not change any compiler defaults. What am I doing wrong??