
unresolved external symbol while calling setvbuf3f
Hi,
I am trying to build the following code:
INTEGER tmp
interface
function setvbuf3f(lu, typ, size)
integer setvbuf3f, lu, typ, size
end function
end interface
WRITE(*,*) "External function call test START"
CALL sleep(2)
tmp = setvbuf3f(6,2,0)
WRITE(*,*) "External function call test STOP"
STOP
END
However I am getting the following linker error:
Quote:
> error LNK2019: unresolved external symbol setvbuf3f_ referenced in function MAIN_
I am using PGI's pgf90 compiler on Windows. According to the
documentation for pgf90, the function setvbuf3f belongs to a
collection of functions and subroutines in the
fortran run-time
library which are known as 3F routines on many systems. These
functions and subroutines are automatically loaded from PGI's Fortran
run-time library if referenced in a Fortran program.
BTW 'sleep' is also mentioned as a 3F subroutine, and it builds fine
if there is a call to 'sleep' only and no reference to setvbuf3f.
I am new to Fortran so I am really not sure whether I have written the
code right. Am I calling the function correctly? Do I need to write
the interface part in my code, or should I simply call the function? I
have tried that too, but it didn't work.
Appreciate any help,
regards,
Abhishek