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 Date: Fri, 28 Jul 2000 17:49:29 +0100 From: Edmund GRIMLEY EVANS To: cygwin AT sourceware DOT cygnus DOT com Subject: Re: building a DLL Message-ID: <20000728174929.R26092@daisy.vocalis.com> References: <20000728172337 DOT Q26092 AT daisy DOT vocalis DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.5i In-Reply-To: <20000728172337.Q26092@daisy.vocalis.com>; from edmundo@rano.org on Fri, Jul 28, 2000 at 05:23:37PM +0100 > For me, step 2 fails with "dlltool: Can't open def file: libt.def". > > Was step 1 supposed to produce this file? It didn't give an error. It > didn't even give a non-zero exit value. Sorry, I was being stupid. It seems to work now. For the benefit of anyone else, here's what I did. To make a library out of t.c and link p.c with it: $ gcc -c t.c $ echo -e "EXPORTS\nfoo" > libt.def $ gcc -s -Wl,--base-file,libt.base -o libt.dll t.o -Wl,-e,_libt_init AT 12 $ dlltool --base-file libt.base --def libt.def --output-exp libt.exp --dllname libt.dll $ gcc -s -Wl,--base-file,libt.base,libt.exp -o libt.dll t.o -Wl,-e,_libt_init AT 12 $ dlltool --base-file libt.base --def libt.def --output-exp libt.exp --dllname libt.dll $ gcc -Wl,libt.exp -o libt.dll t.o -Wl,-e,_libt_init AT 12 $ dlltool --def libt.def --dllname libt.dll --output-lib libt.a $ gcc -c p.c $ gcc -o p p.o libt.a Apart from the function foo, t.c also contains the following: __declspec(dllexport) int foo(int); #include int WINAPI libt_init(HANDLE h, DWORD reason, void *q) { return 1; } int main() { return 0; } Now to try building a real DLL out of source code in Prolog ... -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com