This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

functioncalls in DLL's return garbage


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@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]