unresolved external symbol while calling setvbuf3f 
Author Message
 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



Sun, 03 Jan 2010 20:14:33 GMT  
 unresolved external symbol while calling setvbuf3f
Abhivg:  I just compiled and ran your example using our pgf90 compiler,
Versiion 6.1-1 on our 64-bit platform  It worked fine here giving out put:



 External function call test START
 External function call test STOP
FORTRAN STOP

On my system the pgf90 libraries are at: /usr/global/pgi/linux86-64/6.1/bin
which is in my PATH.

So I'd guess that you may need  to touch base with  the SysAdmin of yoursystem.

Skip Knoble

-|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:
-|> 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



Sun, 03 Jan 2010 21:51:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ??Unresolved External Symbol??

2. LNK2001: unresolved external symbol

3. error LNK2001: unresolved external symbol *******

4. error LNK2001: unresolved external symbol

5. Unresolved external symbol

6. Help: unresolved external symbol

7. DVF dialogs: DFLOGM linking gives unresolved external symbols

8. unresolved external symbol

9. error LNK2001: unresolved external symbol __imp__Tcl_CreateInterp

10. unresolved external symbol

11. (Python C-API) MSVC link: unresolved external symbols

12. Unresolved External Error when trying to use WINAPI call

 

 
Powered by phpBB® Forum Software