I'm Just exactly now fighting same problems. See my last post: "Help with shared library make files"
Note 2 things A. Initialization order is opposite of msvc++ Last object on the linker gets to run first. (msvc first on the command line first to initialize)
B. Hard, in gdb (kdevelop), to set a break point on pre-main code. use below file to do that. Put it as last object linked and after any library. In effect it is an "int 0x03" instruction to hard code a break point.
C. All DLLs linked to the MyApp.dll.so should also link to MyApp.exe.so see my wine post: "wine msvcrt on Library initialization". These are the ones that get linked through winebuild.
<Cpp_Globs_stop.cpp>
#include "windows.h"
#define _CrtDbgBreak() __asm__ ("\tint $0x3\n")
class TestStaticClass { public: TestStaticClass() ; ~TestStaticClass() ; } ;
TestStaticClass::TestStaticClass() { MessageBox(NULL ,"Constructor" ,"Cpp_Globs_stop" ,MB_OK) ; _CrtDbgBreak(); }
TestStaticClass::~TestStaticClass() { MessageBox(NULL ,"Destructor" ,"Cpp_Globs_stop" ,MB_OK) ; }
TestStaticClass g_StaticClass ; </Cpp_Globs_stop.cpp>
<Makefile snippet> $(mfctest_dll_MODULE).so: $(mfctest_dll_MODULE).spec.o $(mfctest_dll_OBJS) Cpp_Globs_stop.o $(LDXXSHARED) $(LDDLLFLAGS) -o $@ \ $(mfctest_dll_MODULE).spec.o \ $(mfctest_dll_OBJS) \ $(mfctest_dll_LIBRARY_PATH) \ $(mfctest_dll_LIBRARIES:%=-l%) \ $(ALL_LIBRARIES) \ Cpp_Globs_stop.o \
</Makefile snippet>
Now you can single step the initialization chain.
flyker wrote:
Boaz Harrosh wrote:
use --wrap in winemaker. Read about this option in the documentation
Thanks. It is work :)