delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/17/15:29:37

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <torsten AT cs DOT auc DOT dk>
To: cygwin AT cygwin DOT com
Subject: Dll problem with NT -nmo-cygwin
Message-ID: <Pine.GSO.4.21.0103172102300.6566-100000@mega.cs.auc.dk>
MIME-Version: 1.0

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 -


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