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


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Wxlua-users mailing list
Wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to