[Developers] Borland 5.5 builds broken DLL

Arni Magnusson arnima at hafro.is
Thu May 21 18:33:40 PDT 2009


Using the simpdll.tpl example from the ADMB manual (attached), I have 
built working Windows DLLs using the current version of ADMB for GCC 
3.4.5, as well as historical versions for Borland 5.2, GCC 2.95.2, and 
Microsoft 6.0.

The only version with which I have not been able to build a working 
Windows DLL is the current ADMB for Borland 5.5:

   tpl2cpp -dll simpdll

   bcc32 -c -O2 -Vd -D__SPDLL;DOS386;OPT_LIB;USE_LAPLACE 
-I%ADMB_HOME%\include simpdll.cpp

   bcc32 -WD -L%ADMB_HOME%\lib simpdll.obj admod32.lib adt32.lib ado32.lib 
df1b2stub.lib

The resulting DLL crashes R:

   x<-rep(0,100); f<-0
   dyn.load("simpdll.dll")
   .C("simpdll", as.integer(length(x)), as.double(x), as.double(f), "")

=> R for Windows GUI front-end has encountered a problem and needs to 
close. We are sorry for the inconvenience. [Close]

The problem lies somewhere in ADMB for Borland 5.5, since the other 
versions of ADMB build healthy DLLs, and ADMB for Borland 5.5 builds 
healthy executables.

---

All in all, the current DLL support appears to be minimal, with only ADMB 
for MinGW GCC creating healthy DLLs for plain models. I still think that's 
an impressive feature, and hopefully it can be extended to other 
compilers, platforms, and ADMB-RE in the future. I'm afraid my 
contribution on this issue is limited to these verbose reports.

Arni


More information about the Developers mailing list