Mail Archives: cygwin/2001/03/17/15:29:37
Hi
I have a dll, which works fine under windows98, but when i run it under
windows NT it crashes as soon as I make an assignment to a static variable
in the dll. The dll was compiled with -mno-cygwin and the crash occurs at
the very first assignment.
I have created a small test program which shows the problem. The dll is
linked against a Borkand Delphi 5.0 application.
Here is the source for the test program:
#include <Windows.h>
int main()
{
return 0;
}
int x;
/* Debug routine to verify that the dll is correctly linked to the app */
int STDCALL ReturnValue(int value)
{
// x = 5; // this assignment causes a crash under winnt
return value;
}
int STDCALL DllEntry(int a, int b, int c)
{
return 1;
}
I build the dll file with this makefile:
file.o: file.c
gcc -c -mno-cygwin -o file.o file.c
file.dll: file.o
gcc -s -mno-cygwin -Wall -Werror -Wl,--base-file,file.base -o file.dll file.o -Wl,-e,_DllEntry AT 12
dlltool --base-file file.base --def file.def --output-exp file.exp --dllname file.dll
gcc -s -mno-cygwin -Wall -Werror -Wl,--base-file,file.base -o file.dll file.o -Wl,-e_DllEntry AT 12
dlltool --base-file file.base --def file.def --output-exp file.exp --dllname file.dll
gcc -mno-cygwin -Wall -Werror -Wl,file.exp -o file.dll file.o -Wl,-e,_DllEntry AT 12
And finally the def file contains:
LIBRARY FILE
DESCRIPTION "Dll built with Cygwin"
EXPORTS
ReturnValue AT 4
Can anyone tell me what is wrong?
Torsten
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -