From: k. h. <kla...@nl...> - 2006-05-29 13:21:53
|
Hi John, I have this in my rules.lua file: ------------------------------------------------------------------------------- -- Set any #includes or other C++ code to be placed verbatim at the top of -- every generated cpp file or "" for none hook_cpp_binding_includes = "#include \"general/include/a2dprec.h\"\n" As it says it should be "at the top". And in my luabind.i I have this at the top: %include "general/include/a2dprec.h" %include "docview/include/doccom.h" %include "docview/include/cparser.h" %include "artbase/include/drawer2d.h" %include "luawraps/include/luawrap.h" But in the bindings generated, a2dprec.h as not at the top anymore. e.g. i get in wxart2d_bind.cpp the following order at the top: #include "wxlua/include/wxlstate.h" #include "luawraps/include/luabind.h" #include "general/include/a2dprec.h" ------------------ And in luabind.h i get this ( lower in file order of include files is different plus a2dprec.h not at the top. ): // ---------------------------------------------------------------------------- // wxart2d.h - headers and tags for wxLua binding // // This file was generated by genwxbind.lua // Any changes made to this file may be lost when file is regenerated // ---------------------------------------------------------------------------- #ifndef __HOOK_WXLUA_wxart2d_H__ #define __HOOK_WXLUA_wxart2d_H__ #include "wxlua/include/internal.h" #include "wxbind/include/wxbind.h" // binding class class wxLuaBinding_wxart2d : public wxLuaBinding { public: wxLuaBinding_wxart2d(); virtual wxLuaBinding* Clone() const { return new wxLuaBinding_wxart2d; } protected: virtual void PreRegister(const wxLuaState& wxlState, bool registerTypes, int luaTable); virtual void PostRegister(const wxLuaState& wxlState, bool registerTypes, int luaTable); DECLARE_DYNAMIC_CLASS(wxLuaBinding_wxart2d) }; // bind wxLuaBinding_wxart2d to a single wxLuaState extern bool wxLuaBinding_wxart2d_bind(const wxLuaState& wxlState); // initialize wxLuaBinding_wxart2d for all wxLuaStates extern bool wxLuaBinding_wxart2d_init(); #include "artbase/include/drawer2d.h" #include "docview/include/cparser.h" #include "docview/include/doccom.h" #include "general/include/a2dprec.h" #include "luawraps/include/luawrap.h" --------------------- Same in luabind.cpp: // ---------------------------------------------------------------------------- // This file was generated by genwxbind.lua // // Any changes made to this file may be lost when file is regenerated. // ---------------------------------------------------------------------------- #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "wxlua/include/wxlstate.h" #include "luawraps/include/luabind.h" #include "general/include/a2dprec.h" This gives me problems to compile it, the #include "general/include/a2dprec.h" for precompiled headers must be at the top. And of course it also important that the order of include files stays the same as defined in the luabind.i. It was oke some time ago, can you change this to be like before? Thanks, Klaas -- Unclassified |
From: John L. <jla...@gm...> - 2006-05-30 00:20:54
|
On 5/29/06, k. holwerda <kla...@nl...> wrote: > Hi John, > > I have this in my rules.lua file: > > -------------------------------------------------------------------------= ------ > -- Set any #includes or other C++ code to be placed verbatim at the top o= f > -- every generated cpp file or "" for none > hook_cpp_binding_includes =3D "#include \"general/include/a2dprec.h\"\n" > > As it says it should be "at the top". > And in my luabind.i I have this at the top: > > %include "general/include/a2dprec.h" Have only one of these. You can also try "hook_cpp_binding_header_includes" in the rules file. > This gives me problems to compile it, the #include > "general/include/a2dprec.h" for precompiled headers must be at the top. > And of course it also important that the order of include files stays > the same as defined in the luabind.i. > > It was oke some time ago, can you change this to be like before? Maybe, I think the problem has to do with writing the bindings out sorted. This really has to be done since lua tables using string keys come out arbitrarily and so CVS diffs are useless and in some cases it seems as though everything gets shifted around even for some tiny little change. There is also the problem that XWindows very rudely #defines "Above" and "Below" which we need to #undef *after* all the includes. Let me know if "hook_cpp_binding_header_includes" works for you, it'll put the #include in the .h binding file right at the top. Do a new checkout, I've adjusted things a little. Regards, John Labenski |
From: k. h. <kla...@nl...> - 2006-05-30 13:08:51
|
John Labenski wrote: > On 5/29/06, k. holwerda <kla...@nl...> wrote: >> ------------------------------------------------------------------------------- >> >> -- Set any #includes or other C++ code to be placed verbatim at the >> top of >> -- every generated cpp file or "" for none >> hook_cpp_binding_includes = "#include \"general/include/a2dprec.h\"\n" >> >> As it says it should be "at the top". >> And in my luabind.i I have this at the top: >> >> %include "general/include/a2dprec.h" > > Have only one of these. You can also try > "hook_cpp_binding_header_includes" in the rules file. If i understand it well, it will not be at the top of "the file", or does that mean something else?. The precompiled header ( which is a2dprec.h ), has to be the very first in every cpp file that is generated, else VC6 gives problems in compiling with it. I am a bit confused, by what is exactly what in the following two: ------------------------------------------------------------------------------- -- Set any #includes or other C++ code to be placed verbatim at the top of -- every generated cpp file or "" for none hook_cpp_binding_includes = "" ------------------------------------------------------------------------------- -- Add additional include information or C++ code for the binding header file. -- This code will be place directly after any #includes at the top of the file hook_cpp_binding_header_includes = "" This evening i can try your modifications from CVS, regards, Klaas -- Unclassified |