This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

problem with building a dll


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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]