Page 1 of 1

collect2: ld returned 1 exit status

PostPosted: Thu Nov 19, 2015 7:08 pm
by Jpv90
Hi, I am learner in Fortran, so my purpose is to understand the WENO advection code, and following write a new code in Matlab or Python. I have got the Fortran code, but when running it, showing the follow error:
In the function 'MAIN__'
code_WENO.f: (text+0x804): reference 'time_' undefined
code_WENO.f: (text+0x2b94): reference 'time_' undefined
collect2: ld returned 1 exit status

I think the error could be in this code's part:

character*8 char_time,yc
open(3,file='1d_single.time')
open(101,file='1.err')
call TIME(char_time)
write(*,*) 'time' ,char_time
write(3,*) 'time: ', char_time
pi=4.0*atan(1.0)
cfl=0.4
tf=1.5/pi
eps=1.e-8
istop=0
md=4
n=80
dx=2.0/n

My OS is Ubuntu 14.

Thanks!!

Re: collect2: ld returned 1 exit status

PostPosted: Mon Nov 23, 2015 6:34 pm
by kwthomas
Hi...

You are calling subroutine TIME, however, when the linker (ld) tries to build the program, it can't find anything called TIME. The compiler you are using may have a TIME subroutine in one of its libraries, however, the library may not be linked by default.