From: John L. <jla...@gm...> - 2006-02-09 19:19:49
|
On 2/9/06, Francesco Montorsi <f18...@ya...> wrote: > > I am compiling on Linux, and in wxluacan.cpp i did see warnings. > > > > wxLUA_USE_wxDC not defined. > yes, I saw this too, together with a couple others. > > > But that means that wxluasetup.h must be included there. > > The wxluacan.cpp is generated, but i am not aware i did add those > > checkes with defines. > IMHO, it should work this way: if one cannot know at code-time which > bindings will be available and which not, then he should enclose all > bindings within #if wxLUA_USE_XXXX #endif pairs and last add the > wxluasetup.h include path. > > However this should not be a very common need because usually one knows > what bindings he will compile for his app and which not. > > for wxLuaCan sample, I think that you can just suppose that all bindings > will be available (and thus remove those #if #endif checks) since custom > wxluasetup.h are used only for custom wxbind library, while wxLuaCan > sample is always linked against wxLua official binding library. I agree about people should know what they're using, but this is a little different, it's in the generated bindings. Since we use data types from the wxWidgets bindings we also get the wxLUA_USE conditions that go with them from the DataTypesCache file (not in cvs). I agree that normally for a sample like this we'd rather not bother to check stuff like "is wxDC wrapped" since unless they take the time to break it, of course it is. I've hopefully fixed this and it compiles and works in MSW using VC Express 2005. > > Anyway, it looks like wxluasetup.h needs to be included in the generate= d > > bindings. > > > > But if i do i get errors that or even worse, telling that: > > s_wxluatag_wxDC was not declared in this scope etc. > > If i also add #include wxbind/include/wxbind.h > > It compiles correctly. > > > > Am i missing something? > This is probably because you should never include wxluasetup.h directly > but, if you really need it, you should rather include > wxbind/include/wxbind.h (and add wxluasetup.h include path to compiler > flags). > > John, am I right ? Yes this is how I did it, but in the wxluacan.rules file for the bindings. Sorry about that, I could have sworn that it used to work. John Labenski |