Subject: functioncalls in DLL's return garbage
From: [email-masked] (uyar)

10 Jul 1997 20:09:00 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0 (WinNT; I)
Original-To: [email-masked]
Original-Sender: [email-masked]

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
"[email-masked]" with one line of text: "help".