Subject: problem with building a dll
From: [email-masked]

28 Jul 1997 07:53:09 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Original-To: [email-masked]
X-Mailer: ELM [version 2.4ME+ PL31 (25)]
Original-Sender: [email-masked]

i failed to build a dll : missing functions.
can you help me ?

andreas
--- logfile ---
echo EXPORTS > iitb.def
nm ../iitb/libiitb.a  dll.o \
|grep '^........ [T] _'\
	|sed 's/[^_]*_//' >> iitb.def
echo "step 1 - ld"
step 1 - ld
ld \
	--base-file iitb.base \
	--dll \
	--output iitb.dll \
	--entry _dll_entry@12 \
	-L/usr/H-i386-cygwin32/i386-cygwin32/lib/ \
	../iitb/libiitb.a  dll.o
echo "step 2 - dlltool"
step 2 - dlltool
dlltool \
	--as=as \
	--base-file iitb.base \
	--def iitb.def \
	--dllname iitb.dll \
	--output-exp iitb.exp 
echo "step 3 - ld (mit exp)"
step 3 - ld (mit exp)
ld \
	--base-file iitb.base \
	--dll \
	--entry _dll_entry@12 \
	--output iitb.dll \
	-L/usr/H-i386-cygwin32/i386-cygwin32/lib/ \
	iitb.exp ../iitb/libiitb.a  dll.o -lcygwin
/usr/H-i386-cygwin32/i386-cygwin32/lib//libcygwin.a(libccrt0.o)(.text+0x8a):libccrt0.cc: undefined reference to `GetModuleHandleA@4'
/usr/H-i386-cygwin32/i386-cygwin32/lib//libcygwin.a(libcmain.o)(.text+0xc):libcmain.cc: undefined reference to `GetModuleHandleA@4'
/usr/H-i386-cygwin32/i386-cygwin32/lib//libcygwin.a(libcmain.o)(.text+0x15):libcmain.cc: undefined reference to `GetCommandLineA@0'
/usr/H-i386-cygwin32/i386-cygwin32/lib//libcygwin.a(libcmain.o)(.text+0x1e):libcmain.cc: undefined reference to `WinMain@16'
make: *** [dll] Error 1

--- dll.c ---
#include <Windows32/Base.h>
int WINAPI dll_entry(HANDLE hDll, DWORD reason, LPVOID reserved)  
{
	return 0 ;
}
asm(".section .idata$3\n" ".long 0,0,0,0, 0,0,0,0");

---Makefile---
LIBS=../iitb/libiitb.a 
OBJS=$(LIBS) dll.o
DLLNAME=iitb
dll:	dll.o
	echo EXPORTS > $(DLLNAME).def
	nm $(OBJS) \
		|grep '^........ [T] _'\
		|sed 's/[^_]*_//' >> $(DLLNAME).def
	echo "step 1 - ld"
	ld \
		--base-file $(DLLNAME).base \
		--dll \
		--output $(DLLNAME).dll \
		--entry _dll_entry@12 \
		-L/usr/H-i386-cygwin32/i386-cygwin32/lib/ \
		$(OBJS)
	echo "step 2 - dlltool"
	dlltool \
		--as=as \
		--base-file $(DLLNAME).base \
		--def $(DLLNAME).def \
		--dllname $(DLLNAME).dll \
		--output-exp $(DLLNAME).exp 
	echo "step 3 - ld (mit exp)"
	ld \
		--base-file $(DLLNAME).base \
		--dll \
		--entry _dll_entry@12 \
		--output $(DLLNAME).dll \
		-L/usr/H-i386-cygwin32/i386-cygwin32/lib/ \
		$(DLLNAME).exp $(OBJS) -lcygwin
	echo "step 4 - dlltool" 
	dlltool \
		--as=as \
		--dllname $(DLLNAME).dll \
		--def $(DLLNAME).def \
		--base-file $(DLLNAME).base \
		--output-exp $(DLLNAME).exp
	echo "step 5 - ld (neues exp)"
	ld \
		--dll \
		--output $(DLLNAME).dll \
		--entry _dll_entry@12 \
		-L/usr/H-i386-cygwin32/i386-cygwin32/lib/ \
		$(DLLNAME).exp $(OBJS)
	echo "step 6 - dlltool ($(DLLNAME).a)"
	dlltool \
		--as=as \
		--dllname $(DLLNAME).dll \
		--def $(DLLNAME).def \
		--output-lib $(DLLNAME).a
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".