lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thank you. Yes, I had to get rid of the union (which makes sense), and move the struct definitions to the same line as the keyword. There were lots of other problems in different files as well, and I'm still having trouble getting the result to compile. I guess it does definitely beats setting up the bindings by hand, I'll just be glad when it's over.

On Nov 12, 2008, at 10:56 AM, Ariel Manzur wrote:

I think the problem is that both the union and the structs inside it
are anonymous, you can't use those with tolua.. Ditch the union (you
don't really need it for the pkg definition), declare the structs as
separate types, then use those to add memebers to SExposedVideoData.

On Tue, Nov 11, 2008 at 6:19 AM, Etherous <etherous@gmail.com> wrote:
Okay, I have a revision to make on my question. It wasn't just that one file. Using the infallible process of elimination, it appears that any pkg file with a struct, class, or typedef (possibly other things as well) in it will cause toLua++ to throw. The only files that it will parse without
errors are simple enum and static function definition files.
On Nov 11, 2008, at 12:39 AM, Etherous wrote:

I'm trying parse some .pkg files with toLua++, but I'm getting an error on one of the files. I can't figure out what the problem is. I'm assuming toLua++ just can't parse something in it, because the original header file is perfect. I think I put all the relevant .pkg code bellow, followed by the
error message:
struct IDirect3D9;
struct IDirect3DDevice9;
struct IDirect3D8;
struct IDirect3DDevice8;
namespace irr
{
namespace video
{
struct SExposedVideoData
{
   union
   {
       struct
       {
           IDirect3D9* D3D9;
           IDirect3DDevice9* D3DDev9;
           s32 HWnd;
       } D3D9;
       struct
       {
           IDirect3D8* D3D8;
           IDirect3DDevice8* D3DDev8;
           s32 HWnd;
       } D3D8;
       struct
       {
           s32 HDc;
           s32 HRc;
           s32 HWnd;
       } OpenGLWin32;
       struct
       {
           void* X11Display;
           unsigned long X11Window;
       } OpenGLLinux;
   };
};
} // end namespace video
} // end namespace irr

-- Error Output --
stack traceback:
[string "tolua embedded: src/bin/lua/basic.lua"]:91: in function
'tolua_error'
[string "tolua: embedded Lua code 22"]:5: in main chunk
** tolua internal error: [string "tolua embedded:
src/bin/lua/container.lua"]:737: #parse error.

stack traceback:
[string "tolua: embedded Lua code 22"]:6: in main chunk
PS: You might notice that this is Irrlicht code, and you may want to suggest
I use IrrLua. Don't