s-news
[Top] [All Lists]

Creating DLLs with Borland C++ 5.5

To: <s-news@lists.biostat.wustl.edu>
Subject: Creating DLLs with Borland C++ 5.5
From: "Tom O'Malley" <omalleyta@cox.net>
Date: Fri, 13 Jun 2008 13:11:38 -0400

Hello,

I am attempting to create "S.dll" using the Borland C++ 5.5 compiler.
I use S-PLUS 6.0 and Windows XP. I will illustrate my problem using the
simple C program "my_sin.c" found on page 650 of the SPLUS-6
Programmer's Guide.

   extern double sin(double);    /*  line 1  */
   __declspec(dllexport)         /*  line 2  */
   void  my_sin(double *x)       /*  line 3  */
   {                             /*  line 4  */
      *x = sin(*x);              /*  line 5  */
   }                             /*  line 6  */

Line 2 has been added to the code because it is required for exporting
the function my_sin.

From page 20 of the on-line complements to the book "S Programming" by
Venables and Ripley, the appropriate commands to create "S.dll" are

bcc32  -u- -6 -O2 -WDE  my_sin.c
ren  my_sin.dll  S.dll

I get the error message:
Unresolved external 'sin' referenced from C:\ProjectSin\my_sin.obj

In attempting to resolve this error, I have tried numerous fixes and
revisions, but all these attempts were unsuccessful. From this work,
my tentative conclusion is this:

   If the C function to be exported ("my_sin" in my example) contains
   a call to some OTHER C function  ("sin" in my example), then
   difficulties will occur.

Is this conclusion correct ?  If so, is there a work-around that will
solve the problem ?  Any help will be greatly appreciated.

Tom O'Malley
3410 Wooster Rd. #613   Rocky River OH 44116
Tel.   440-333-2870
Email 
omalleyta@cox.net


 

<Prev in Thread] Current Thread [Next in Thread>
  • Creating DLLs with Borland C++ 5.5, Tom O'Malley <=