delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/28/07:53:09

From: urcr AT rz DOT uni-karlsruhe DOT de
Subject: problem with building a dll
28 Jul 1997 07:53:09 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199707281116.EAA17495.cygnus.gnu-win32@cygnus.com>
Mime-Version: 1.0
Original-To: gnu-win32 AT cygnus DOT com
X-Mailer: ELM [version 2.4ME+ PL31 (25)]
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 AT 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 AT 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 AT 4'
/usr/H-i386-cygwin32/i386-cygwin32/lib//libcygwin.a(libcmain.o)(.text+0xc):libcmain.cc: undefined reference to `GetModuleHandleA AT 4'
/usr/H-i386-cygwin32/i386-cygwin32/lib//libcygwin.a(libcmain.o)(.text+0x15):libcmain.cc: undefined reference to `GetCommandLineA AT 0'
/usr/H-i386-cygwin32/i386-cygwin32/lib//libcygwin.a(libcmain.o)(.text+0x1e):libcmain.cc: undefined reference to `WinMain AT 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 AT 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 AT 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 AT 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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019