Mail Archives: cygwin/1999/09/24/21:52:22
--------------880A225C58B2EBE8FD13B57C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello all,
I was able to create my dll library successfully and thought I would
share with everyone what I did to get my code to work. I am by no
means an expert in this stuff, so if I state an inaccuracy here it is
not
intentional, I just thought I would share my newbie experience with
the rest of my ilk.
Anyway my problem was basically this: I had some old C code (circa
1991)
that was written for Sco Unix 3.2 that I was so fortunate to inherit,
this code
was not written with portability in mind and had little to no comments
to aid
in deciphering. Since I did not write this code I decided that
translating this code
to Java would take too long (probably a month). I didn't need all of the
code either
since alot of the functionality from the Unix GUI would be taken over by
an application
called Arcview (COTS mapping software ), I just needed the C code that
did alot of
intense math. When I learned that Arcview could load DLL's to extend
it's functionality
I remembered reading the cygwin documentation about how to build DLL's
with gcc. At
first I thought this would be relatively straight forward, maybe for a
windows programmer
it is, but I have been programming in the Unix environment for the last
three years and found
myself hopelessly stuck with the instructions in the cygwin
documentation. The
problem with the instructions provided in the cygwin documentation (for
me anyway)
was that it was specific to building DLL's that would be called from a
Cygwin C program,
I guess I mean more specifically a program that would rely on the Cygwin
runtime
libraries as opposed to the windows native libraries like kernel32.dll
Also, after browsing
through the mailing list archives I came upon references to "creating
DLL's that can be called
from excel and other windows programs", and I found example C source
code and a Makefile
that was very informative. The only other piece that was missing from
that was a ld option for
the entry point of the DLL, I found this in an example of a Java Native
Interface call to a dll, the
Makefile for that example had this option
"-M1,-e,_cygwin_nocygwin_init AT 12" that was part
of the DLL_LDOPTIONs macro. After adding that to my Makefile my dll
worked like a champ.
Hopefully someone else might find this info useful, but if your a
newbie like me you will probably
have to search the mailing list to find an answer close to your specific
problem.
I will say this, the time I spent figuring out how to create a windows
DLL through Cygwin is
nothing compared to what I would of had to do without it. My many thanks
to the persons
responsible for this great product. It's great running BASH on a NT
workstation, it makes a Unix
programmer feel more at home.
Eric
--------------880A225C58B2EBE8FD13B57C
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Received: from hp2.xraylith.wisc.edu [128.104.182.236] by mail.pcbank.net with ESMTP
(SMTPD32-5.05) id A33DA3012A; Fri, 24 Sep 1999 15:38:37 -0400
Received: from localhost (khan AT localhost) by hp2.xraylith.wisc.edu with SMTP (8.7.6/8.7.1) id OAA07524 for <number6 AT pcbank DOT net>; Fri, 24 Sep 1999 14:41:58 -0500 (CDT)
X-Authentication-Warning: hp2.xraylith.wisc.edu: khan owned process doing -bs
Date: Fri, 24 Sep 1999 14:41:58 -0500 (CDT)
From: Mumit Khan <khan AT xraylith DOT wisc DOT edu>
To: Eric Feliu <number6 AT pcbank DOT net>
Subject: Re: A newbie who is stuck with creating a DLL
In-Reply-To: <37EAC9AB DOT 57D6A445 AT pcbank DOT net>
Message-ID: <Pine DOT HPP DOT 3 DOT 96 DOT 990924144103 DOT 7210E-100000 AT hp2 DOT xraylith DOT wisc DOT edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-RCPT-TO: <number6 AT pcbank DOT net>
On Thu, 23 Sep 1999, Eric Feliu wrote:
> Thanks for your advice, I was able to get my DLL to work after I searched
> through
> the mailing lists very extensivley. A piece of info here and there and I
> finally got it to work.
> Again thanks for the advice and patience.
Eric,
Glad it worked out!
Perhaps you could summarize the problems you've had and how you tracked
down the solutions and post it to the list? It may help the next `n' users
who will inevitably run into the same problem.
Regards,
Mumit
--------------880A225C58B2EBE8FD13B57C
Content-Type: text/plain; charset=us-ascii
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
--------------880A225C58B2EBE8FD13B57C--
- Raw text -