This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Problems with using DLL
- To: gcc@gcc.gnu.org
- Subject: Problems with using DLL
- From: martin <martin@ist.org>
- Date: Thu, 26 Aug 1999 22:28:29 +0100
Hi!
I am using gcc version egcs-2.91.60 in a cygwin Linux emulation shell
(GNU bash version 2.02.1(2)-release (i586-pc-cygwin32)) under Windows95.
I wrote a small program in C using a DLL (ML32I2.DLL; Mathlink for
Windows) for several function calls. Since there were only Microsoft
import libraries available (*.lib) I created my own gcc-style import
library for the DLL using dlltool and a (selfmade) def-file.
Gcc builds the program without any complaints (except for two warnings
not related to my problem).
When running the executable everything works fine, until AFTER executing
the very last statement of the code (that is: printf("Exiting Now!\n");
) I get an error message from Windows reading (I'm translating from
German):
a.exe caused error by page fault
in module ML32I2.DLL at 0217:10005eaa.
register:
EAX=00000000 CS=0217 EIP=10005eaa EFLGS=00010246
EBX=0253fdf8 SS=021f ESP=0253fdcc EBP=0253fe00
ECX=005107ec DS=021f ESI=00416084 FS=4c97
EDX=00416084 ES=021f EDI=00000000 GS=0000
bytes at CS:EIP:
8b 07 50 8b 51 08 52 e8 2a b4 ff ff 83 c4 08 85
stack values:
815aabe4 0051031c 0253fe04 00000001 7fd10c3f bff798b7 815aa6c8 10003fb5
00416084 0253fdf8 0253fe00 00000000 004016ef 00000000 0253fe38 7fd013d6
I cannot gather much from this message (since my knowledge of DLLs and
Windows is not very profound), but my questions are:
What exactly does this message mean ?
Can it be a coding error even when the error occurs after the last
statement ?
Is there a way of not deinitializing a DLL properly such that it causes
an error on program exit ?
Is it likely that the error has been caused by dlltool when creating the
import library ?
Is it likely that the error has been caused while linking with the
import library ?
I would be very glad about any advise.
--Martin