delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/10/20:09:00

From: uyar AT athene DOT informatik DOT uni-bonn DOT de (uyar)
Subject: functioncalls in DLL's return garbage
10 Jul 1997 20:09:00 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <33C532C1.72C9.cygnus.gnu-win32@athene.informatik.uni-bonn.de>
Mime-Version: 1.0
X-Mailer: Mozilla 3.0 (WinNT; I)
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

I'm writing a console App which uses a dll.

But it does not work correctly !.

The compilation terminates without errors but the called functions in
foo.DLL 
return only Garbage !

To be more precise :

	If I call a Function in Foo.DLL from my Program like 
	foodll_Func ( char * strText);
	
	The provided Pointer contains only garbage;
	and a  following ,,for-loop" goes crazy :

	for ( i=0 ; i < 6500 ; i++)
         printf ("%c" strText[i]);

	it terminates immadiatly at i==0

	but this should not be the correct behaviour.


Only the DLL is available so I have created a library with the command 

dlltool --def foo.def --dllname foo.dll --ouput-lib foo.o


Is there a commandline-option to pass to gcc or to the linker which I've
forgotten.

My makefile looks like this:

# Makefile -- BEGIN --
all=GnuTest

LIBS=   -lcygwin -lapodll32 
 
GnuTest:GnuTest.cc
	gcc -g GnuTest.cc $(LIBS)  -o GnuTest.exe

clean: 
	rm -f GnuTest.exe
#Makefile -- END --

The same sort of behaviour I found in emxgcc port.
Has anyone an idea

Thanks in advance!
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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