From: John L. <jla...@gm...> - 2005-12-28 22:04:35
|
> Do not forget to modify apps.dsw ( somewhere in bakefiles ) to add that > option. Fixed (if I understand bakefile correctly), I'm recompiling it now and so far so good. > And you are right about static initialization, trhis is a problem, > having the following bindings: > > class wxart2d_BindingInit > { > public: > wxart2d_BindingInit() > { > m_binding.GetBindingList()->Append(&m_binding); > } > wxart2d_Binding m_binding; > }; > > wxart2d_BindingInit s_wxart2d_BindingInit; > > This last static instance is not called. ( it is inside a libary here ). > If i move to my main program, it is called, but to early because the next > wxLuaBindingList wxLuaBinding::sm_bindings is not yet initialized. Can you not do this at all, because it is in a library? I thought this would be a clever trick to ensure that all the bindings were initialized and made available at runtime. This way you do not have to know the name of anything and so we can even remove the dependence on the wxWidgets binding. What would be an alternative? One way would be to make the user add any bindings they want to a static member of wxLuaBinding themselves in the wxApp::OnInit. The only reason to have the static member is so that they don't have to always add the bindings everytime they create a new wxLuaState, but by default it will try to load the ones set to the static wxList of them. > First i don't understand why it is not called when it is part of my > luawraps library. > ( the library is linked, and i can a wxart2d_Binding dummy in my main, > so it is there ). > Next i don't know how to change the order of initialization of static > objects. I thought they are "run" in the order that they're linked. Or in the cases of some compilers, the reverse order that they appear on the linking command line. > I will ask Michael now, maybe he knows a solution, Hopefully. -John Labenski > John Labenski wrote: > > >>>No back to wxArt2D to see if it is the same there ;-) > >>> > >>> > >>> > >>just added the same switch, and now it is oke. > >> > >> > > > >Thats good, I have no idea how to fix static initialization problems > >elegantly. I would have had use a brute force method that just rems > >out static code (and anything that depends on it) until it worked. > > > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > Wxlua-users mailing list > Wxl...@li... > https://lists.sourceforge.net/lists/listinfo/wxlua-users > |