This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: 1.5.19-4: global constructors not working with dlopen()


I tried your example duplicating your error. I played with it and change it
little bit to get it to work. Instead of using printf() in your T1_dl.c I used
cout and compiled it with g++ instead of gcc. Could it be you mixed C++ streams
used in your T1 class with old C printf-family what brings your application in
knee? I won't be surprised, I read somewhere that this two concepts should not
be mixed.

PV


> I'm having trouble with global constructors/destructors not
> executing/crashing within a dlopened DLL.
>
> I've attached a test-case.
> FYI: This works fine with 1.5.13-1.
>
> Thanks for your help.
> Martin
>
> ps:
> Here's my shell log.
>
> Martin@viper[523]$ make clean
> /bin/rm -f T1_dl *.exe *.dll *.so *~ mapfile
> Martin@viper[524]$ make; ./T1_dl
> g++ -Wall -Wl,-Map,mapfile -shared T1.cpp T1_inst.cpp -o T1_inst.dll
> gcc -Wall T1_dl.c -o T1_dl
> opening...
> Martin@viper[525]$ make nocygwin; ./T1_dl
> g++ -Wall -mno-cygwin -shared T1.cpp T1_inst.cpp -o T1_inst.dll
> gcc -Wall T1_dl.c -o T1_dl
> opening...
> T1 object created.
> opened successfully
> closing...
> T1 object deleted.
> closed
> Martin@viper[526]$ make t1inst; ./T1_inst
> g++ -Wall -DT1_INST_EXE T1.cpp T1_inst.cpp -o T1_inst
> T1 object created.
> running
> exiting...
> T1 object deleted.
> Martin@viper[527]$


----------------------------------------------------
Sent through the University of Leoben webmail system


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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