Hello All,
I have been attempting to reconstruct F90 code into a DLL for use with
S-Plus and R.
There are several modules that serve different purposes.
Some simply contain related functions and subroutines.
Some contain parameter values
Some contain type definitions and variable declarations
I can build and connect to the DLL when I use the modules that contain
parameter values, but when I try to use variables that have been declared in
a module in a subroutine that used that module I have problems when it comes
to linking.
I get the following message:
Linking...
Creating library Release/sTSA.lib and object Release/sTSA.exp
sTSA.obj : error LNK2001: unresolved external symbol _kind_module_mp_amin2
Release/sTSA.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
The main subroutine is currently: (simplified)
subroutine STSA (..., logLik)
use kind_module
!DEC$ ATTRIBUTES DLLEXPORT:: STSA
!DEC$ ATTRIBUTES ALIAS:'stsa_' :: STSA
...
...
Real(wp), intent(out) :: logLik
! call set_up_data_structures
amin2 = int(1)
logLik = 999.d0
return
end subroutine STSA
Kind module simply contains
module kind_module
integer, parameter :: wp = kind(1.0d0) ! kind-value for
double precision
integer :: amin2
end module kind_module
Do I have to explicitly export / import every variable that is defined in a
module? Do I have to define variables in the main subroutine? Any help
would be appreciated.
Kind regards,
Colin.
|