Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Sat, 17 Mar 2001 21:29:13 +0100 (MET) From: Torsten Iversen To: cygwin AT cygwin DOT com Subject: Dll problem with NT -nmo-cygwin Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 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