Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Mon, 3 Dec 2001 04:54:51 -0600 From: Lester Ingber To: cygwin AT cygwin DOT com Subject: anyone using 1.35 to prepare DLLs? Message-ID: <20011203045451.A4356@ingber.com> Reply-To: Lester Ingber Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.23i X-URL: http://www.ingber.com/ X-URL-ALT: http://www.alumni.caltech.edu/~ingber/ I have had mixed results preparing DLLs to be called from Maple7 (an algebraic software package) under Windows 2000. I can get only as far as preparing a function without arguments, based on a posting 14 Jun 00 by Carl Thompson: ------------8<------------ top cut -> bottom ------------->8------------ However, if foo() should go into a DLL, your files need to look like this: --- foo.c --- /* declaration (AKA prototype) of foo(), usually found in .h file */ __declspec(dllexport) int foo(); /* exporting foo() from this DLL */ /* definition of foo() */ int foo() { return 1; } ------------- Make a DLL from foo.c: gcc -c foo.c -o foo.o gcc -Wl,--out-implib,libfoo.import.a -shared -o foo.dll foo.o This will create the DLL (foo.dll) and the import library for the DLL (libfoo.import.a). ------------8<------------ bottom cut <- top ------------->8------------ I do not need to use libfoo.import.a to use foo.dll from Maple7. I cannot get this to work if I change foo.c to --- foo.c --- __declspec(dllexport) int foo(int i); int foo(int i) { return (i + 10); } ------------- I've tried examples from some older postings, dating back to 1997 and 1998, but these do not seem to work out. Is anyone using a current cygwin to prepare DLLs? Thanks. Lester P.S. I have a Sun PCi card in my Ultra10 running Windows 2000. Unlike some older cygwin I had a year or so ago, I could not get gcc to compile when cygwin was installed on a shared Unix directory, though other software runs fine this way. However, when I installed cygwin on my D drive, it seems to work fine. -- Prof. Lester Ingber ingber AT ingber DOT com ingber AT alumni DOT caltech DOT edu www.ingber.com www.alumni.caltech.edu/~ingber -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/