Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: From: "Kenneth Sandberg (ERA)" To: "'cygwin AT sourceware DOT cygnus DOT com'" Subject: Re: Problems using a DLL created with GNU from Microsoft VC++ Date: Wed, 9 Aug 2000 07:44:03 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2651.58) Content-Type: text/plain; charset="iso-8859-1" X-OriginalArrivalTime: 09 Aug 2000 05:44:06.0371 (UTC) FILETIME=[D4EA3330:01C001C4] I have used the unix/gnu/posix functions in cygwin to compile the code. Following script have been used to compile the code: #! /bin/sh # Example Script to compile and link a relocatable DLL # Files that make up the DLL = foo.c foo2.c init.cc fixup.c # (init.cc and fixup.c are housekeeping routines needed for the DLL. The actual # library routines are in foo.c and foo2.c) # ***Fill in your path to libcygwin.a here (with ni trailing slash)*** LIBPATH=/lib # Compile source files: g++ -c foo.c g++ -c foo2.c g++ -c init.cc g++ -c fixup.c # Make .def file echo EXPORTS > fooB.def nm foo.o foo2.o init.o fixup.o | grep '^........ [T] _' | sed 's/[^_]*_//' >> fooB.def # Link DLL ld --base-file fooB.base -dll -o fooB.dll foo.o foo2.o init.o fixup.o \ /lib/libcygwin.a -e _dll_entry AT 12 dlltool --as=as --dllname fooB.dll --def fooB.def --base-file fooB.base --output-exp fooB.exp ld --base-file fooB.base fooB.exp -dll -o fooB.dll foo.o foo2.o init.o fixup.o \ /lib/libcygwin.a -e _dll_entry AT 12 dlltool --as=as --dllname fooB.dll --def fooB.def --base-file fooB.base --output-exp fooB.exp ld fooB.exp -dll -o fooB.dll foo.o foo2.o init.o fixup.o\ /lib/libcygwin.a -e _dll_entry AT 12 # Build the fooB.a lib to link to: dlltool --as=as --dllname fooB.dll --def fooB.def --output-lib fooB.a # Linking with main g++ main3.c -o main3.exe Kenneth Sandberg -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com