How to print out from DLL

Mishel bymi at
Tue Feb 17 11:48:53 CET 2004


I have a problem with printing to the standart output from DLL.
1. I create simple DLL(aaaDll.dll) in the MVS 6.0. This DLL has only one 
function(fnAaaDll()), which prints some strings.
2. I create another console application project(aaaTestDll.cpp) in MVS 6.0 
which has only main function. In this function I call function from DLL(befor a 
link the interface library for DLL). In this case I have all printings in the 
3. I cleate the interface library for this DLL in the Cygwin:

cd ./Release
echo EXPORTS > aaaDll.def
echo fnAaaDll >> aaaDll.def
dlltool --def aaaDll.def --dllname aaaDll.dll --output-lib libAaa.a
cp libAaa.a /usr/local/lib/libAaa.a
cd ..

and I compile my test programm in the Cygwin(see makefile):

AAALDPATH = -L/usr/local/lib
CC		= g++ -pipe -Wno-deprecated
LN		= g++ -static
LIBS	= -lAaa 

WARN    = -Wall -Wbad-function-cast -Wcast-qual \
	  -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
	  # -Wcast-align -Wredundant-decls -Winline


APPOBJS	=	aaaTestDll.o

	$(LN) -o $@ $(APPOBJS) $(LDPATH) $(LIBS)
	strip $@.exe
%.o: %.c
	$(CC) -c -g -Wall $(DEF) $(INCL) $< -o $@

	rm -f *.o
	rm -f .depend
	rm -f $(APPNAME).exe
	make -f makefile .depend

	$(CC) $(DEF) $(INCL) -E -M -MG $(shell ls *.c*) > .depend

include .depend

I run result and no printings on the console!
Question: How I can print from the DLL under Cygwin?

Best regards,

More information about the kde-cygwin mailing list