The NAg routines must be on the search path - put them in <Windows>\System32. If they, in turn, call any DLLs (this should be in the NAg documentation) then these should also be on the search path. I find it easiest to put *all* DLLs in the System32 folder to avoid this problem. Regards, Jeremy > Message Received: Apr 28 2006, 03:37 PM > From: "Colin Millar" > To: [log in to unmask] > Cc: > Subject: Re: USEing modules in DLL's > > Yeah I've been tying myself in knots. The problem was the case of the > exported symbols. I've solved that one, now the problem is when I use NAG > routines in the DLL s-Plus won't load the DLL. > > Hey Ho. Sorry to have bothered you. > Colin. > > -----Original Message----- > From: Jeremy Dudley [mailto:[log in to unmask]] > Sent: 28 April 2006 11:29 > To: [log in to unmask] > Subject: Re: USEing modules in DLL's > > I'm not sure that I understand the problem. > > You have a DLL, with a subroutine. That subroutine uses modules. > > logLik is defined as a parameter to the routine. > > I don't see the problem, especially as we have been doing this for several > years. > > The error message implies that you have a name called mp_amin2 that is not > being found, and is unrelated to your use of logLik. Because it talks of an > external, that would suggest that somewhere you have a statement of either > > CALL mp_amin2(...) > > or > > ... = mp_amin2(...) > > There is not enough code to diagnose further. > > > > Message Received: Apr 26 2006, 01:49 PM > > From: "Colin Millar" > > To: [log in to unmask] > > Cc: > > Subject: USEing modules in DLL's > > > > 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. > > > > > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > ______________________________________________________________________ > >