From: John L. <jla...@gm...> - 2006-02-03 22:50:19
|
The library wxbindstc has a wxModule in it and unfortunately the OnInit() function is not run. I suspect that the linker is throwing away the whole library since it's "not used". Just to refresh, each binding has a wxModule that adds itself to a list of bindings in wxLuaBinding. See the bottom of wxbind/src/wx_classes.cpp and wxbindstc/src/wxstc_classes.cpp. The only solution that seems to work is to add a C function that explicitly adds the binding. This requires that in everybody's wxApp::OnInit or at least before the first use of wxLua they call each C binding function to initialize it. Any problems with getting rid of the wxModule way and adding the C functions to put this initialization problem behind us? There is one catch, it's hard to #include "wxbind/include/wxbind.h" since it #includes "wxluasetup.h" so you have to add the path to that as well, even though you don't really need it. A simple way around that is to use extern, is this too "unprofessional?" extern void wxLuaBindingInit_wx(); extern void wxLuaBindingInit_wxstc(); MyApp::OnInit() { wxLuaBindingInit_wx(); wxLuaBindingInit_wxstc(); ... } Regards, John Labenski |