I want to link my Fortran code with this Fortran made DLL.
In simple way...
Fortran program (editable code) --LINK-- Fortran DLL (uneditable) (linking method via Fortran program code??)
I want to make a program where I do not want to show my codes (this part will be in DLL form).
For example:
i have a code for DLL in intel fortran that is
SUBROUTINE TWICE(x,y)
IMPLICIT NONE
!DEC$ ATTRIBUTES DLLEXPORT::TWICE
REAL, INTENT(IN) :: x
REAL, INTENT(OUT) :: y
y=2*x
END SUBROUTINE TWICE
now I want to use this DLL in another program . The new program is separate program and I want to use this DLL in the Intel fortran written below.
PROGRAM TestToCallDLL
IMPLICIT NONE
!DEC$ ATTRIBUTES DLLIMPORT::TWICE
REAL :: x,y
WRITE(*,*)'x?'
READ(*,*)x
CALL Twice(x,y)
WRITE(*,*)'x twice = ',y
END PROGRAM TestToCallDLL
The error is:
Error 1 error LNK2019: unresolved external symbol __imp__TWICE referenced in function _MAIN__ twiceTEST.obj
Error 2 fatal error LNK1120: 1 unresolved externals Debug\twiceTEST.exe