Fernando Campos
Fernando Campos

Reputation: 1

Undefined reference to `rindex_`

I have a code in Fortran 77 (*. f). I use the compiler fort77 but it gives me the following error:

   geodv.o: In function `main__ ':
   fort77-10104-1.c: (. text +0 x287): reference to `rindex_ 'undefined
   collect2: error: ld returned 1 exit status

The code can be found at this dropbox. Thank you for your help

Upvotes: 0

Views: 328

Answers (2)

agentp
agentp

Reputation: 6989

try this:

        nd1 = index(entete,'/')
    nd2 = index(entete(nd1+1:),'/')+nd1

note this will give the position of the second '/' , not the last, so it is the same only if your string has just two '/'s..

Upvotes: 0

Kyle Kanos
Kyle Kanos

Reputation: 3264

You have declared rindex to be an integer*4 on line 15, but use it as nd2=rindex(entete,'/') in line 62. Fortran expects line 62 to mean that rindex is a function, not an integer.

Upvotes: 1

Related Questions