From: John L. <jla...@gm...> - 2005-12-30 16:09:06
|
> >Yes, it's not compiled with debug info. Why do you want to debug into lu= a? > > > So i can see on the stack where things are called from. It helps me to > understand why things are organized the way they are. The only really > existing documentation is on Lua itself. Ok, we can try to turn on debug info. I'll have to see if I can do it in the bakefiles? Do you know how? > >Humm, the MSVC linker is too clever for its own good. But, the default > >wxWidgets binding works in VC 2003, are you sure this is really the > >case? > > > Yes i am sure, i did test it again just now. If i outcomment them, my > bindings are not initialized, and or not found. The debugger does not > even stop there, and say at start that the breakpoints are invalid. > Put them in again and everything works fine, and the debugger nicely > stops too. Ok, so there really is a problem. > >So... it works now? No need for a wxModule? > > > I don't think it works without problem, it only works under certain > conditions. As soon one has his bindings inside a library, the main > program must contain something from that library, else the library will > not be linked. The order of initilization is something different from tha= t. > > That it currently works for me, is because my intialization order seems > to be oke, and i forces the initialization of the static binding by > adding a dummy static wxart2d_Binding in my main program. > In fact i did a test right now, just a dummy wxart2_binding already > makes it link the library, it does not have to be static. So, I got your email from Michael, I don't understand the first part. I guess I'm missing some of the lingo. >1. Rely on 0-initialization for 'first objects' and don't touch them >in their constructors (maybe use a special constructor for this). The >0 intialization of all objects is guaranteed to be finished before any >constructors are called. But of course the real constructor can be >called later at any time, so it must not touch e.g. the list head, >that might already have been valid data. Can you give me an example? The second example of guaranteeing static var initialization works like this, right? We have no problem doing this and Michael says the only downside is code bloat, but we're not going to have very many of these, so that's not an issue. This can be easily automated in genwxluabind.lua. static wxLuaBinding* wxLua_GetMyBinding() { static wxLuaMyBinding m_binding; return &m_binding; } Thanks, John Labenski |