problems with building a dll with the b18 package

Daphne69@aol.com Daphne69@aol.com
Thu Nov 27 12:45:00 GMT 1997


I'm trying to build a dll with the cynwin32 environment. I've tried using the
several simple examples from the web page. Should have 'just worked'. However
I get a 'illegal write access' or something to that effect when a run the
results.

I've tried both the relocatable and non-relocateable versions. When I use
gdb, the dll seems to load. However at some point it fails in a console
initialization
routine.

compile commands...


#!/bin/sh
LIBPATH=/gnuwin32/b18/H-i386-cygwin32/i386-cygwin32/lib

gcc -c foo.c
gcc -c foo2.c
gcc -c init.cc
gcc -c fixup.c

echo EXPORTS > fooB.def
nm foo.o foo2.o init.o fixup.o | grep ' [TC] ' | sed 's/[^_]*_//' >> fooB.def
ld --base-file fooB.base --dll -o fooB.dll foo.o foo2.o init.o fixup.o \
 $LIBPATH/libcygwin.a -e _dll_entry@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 \
 $LIBPATH/libcygwin.a -e _dll_entry@12

dlltool --as=as --dllname fooB.dll --def fooB.def --output-lib fooB.a

gcc main.c fooB.a -o testdll.exe

------- result from gdb for testdll.exe ----

(gdb) run
Starting program: /gnuwin32/b18/src/testdll/testdll.exe 
10000000:/gnuwin32/b18/src/testdll/fooB.dll
warning: LDR: Automatic DLL Relocation in testdll.exe

warning: LDR: Dll cygwin.dll base 10000000 relocated due to collision with
d:\gnuwin32\b18\src\testdll\fooB.dll

2520000:/usr/bin/cygwin.dll

[failed reading symbols from DLL]
"/WINNT/system32/kernel32.dll": error reading line numbers


[failed reading symbols from DLL]
"/WINNT/system32/advapi32.dll": error reading line numbers

77e70000:/WINNT/system32/USER32.dll
77ed0000:/WINNT/system32/GDI32.dll
77e20000:/WINNT/system32/RPCRT4.dll
776d0000:/WINNT/System32/wsock32.dll

[failed reading symbols from DLL]
"/WINNT/System32/WS2_32.dll": error reading line numbers

78000000:/WINNT/system32/MSVCRT.dll

[failed reading symbols from DLL]
"/WINNT/System32/WS2HELP.dll": error reading line numbers


Program received signal SIGSEGV, Segmentation fault.
0x252bac6 in fhandler_console::is_console ()
(gdb) 
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list