"Application Error" Problem with DLLs, C++, egcs, NT

Paul Henshaw paul.henshaw@jrc.it
Mon Aug 16 06:11:00 GMT 1999


Dear All,

	I am trying to port a number of C++ library and related
	applications to NT using cygwin.  

	I have managed to build	the system using static libraries 
	(a la libFoo.a), and things seem to work.  

	Following the various instructions I found regarding dllwrap
	and dlltool, I can now build a dll and associated import 
	library and link a test application.

	The application runs correctly, but when it terminates a
	popup box is displayed telling me:

	  testDayOfYear.exe - Application Error
	  The instruction at "0x6105afe2" referenced memory at
	    "0x0000000e".
 	  The memory could not be written.

	  Click OK to terminate the application
				[ OK ]
	
	The same application runs to completion without error when
	linked statically.

	This is my first adventure in NT land, and so I'm probably doing
	something stupid.  Could any kind soul give me some clues?

	Here's what I'm running:

	 Windows NT workstation on a Pentium II 350
	 Cygwin 20b1
	 egcs-1.1.2
	 dllwrap 0.2.4
	 dlltool 2.9.4
	
	I'm currently building the dll like this:

	dlltool --export-all --output-def $(LIBDIR)/$(DEF) $(LIBOBJS)
	dllwrap --driver-name g++ --implib $(LIBDIR)/$(STATICLIB) \
	        --def $(LIBDIR)/$(DEF) -o $(BINDIR)/$(DLL) $(LIBOBJS)

	
	although I've also tried various other incantations along the
	lines of:
	
  	  echo "EXPORTS" > $(DEFS)
	  nm -o $(LIBOBJS) | grep ' T _' | sed -e 's/.* T_//' >> $(DEFS)

	I'm a little confused by the different instructions for building
	and using DLLs, and am not at all sure that I am tackling the 
	problem in a remotely sensible fashion.

	Any help or advice anyone can offer is very much appreciated,

		Cheers,
				Paul

Paul Henshaw, Institute for Systems, Informatics and Safety 
TP270,  JRC Ispra,  21020 Ispra (VA),  Italy
Tel:    ++39 0332 785262        Fax: ++39 0332 789185
WWW:    http://gist.jrc.it:8080/paul.gx


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list