   Can't get my Luabind desc class to work.
  I need to create a desc class to pass the information I need to my window class since luabind has a limit to the number of variables that can be passed to the constructor.This is what I did but it crashes for some reason when I try to change one of the variables:class E_WINDOW_DESC{public:E_WINDOW_DESC(){name = "";icon = "";left = 0;top = 0;width = 640;height = 480;close = true;maximize = true;minimize = true;sizeable = true;}const char*name;const char*icon;unsigned intleft;unsigned inttop;unsigned intwidth;unsigned intheight;boolclose;boolmaximize;boolminimize;boolsizeable;};//...luabind::module(g_Lua)[    luabind::class_<E_WINDOW_DESC>("Window_Desc")   .def(luabind::constructor<>()).def_readwrite("name", &E_WINDOW_DESC::name).def_readwrite("icon", &E_WINDOW_DESC::icon).def_readwrite("left", &E_WINDOW_DESC::left).def_readwrite("top", &E_WINDOW_DESC::top).def_readwrite("width", &E_WINDOW_DESC::width).def_readwrite("height", &E_WINDOW_DESC::height).def_readwrite("close", &E_WINDOW_DESC::close).def_readwrite("maximize", &E_WINDOW_DESC::maximize).def_readwrite("minimize", &E_WINDOW_DESC::minimize).def_readwrite("sizeable", &E_WINDOW_DESC::sizeable)];Then I try this in lua and it crashes:Desc = Window_Desc()Desc.name = "Bob"Does anyone have an idea why this does not work?[Edited by - CodaKiller on May 14, 2009 4:54:15 PM]
  Please post the exact text of any and all error messages you get during the crash.   ;Quote:Original post by ApochPiQPlease post the exact text of any and all error messages you get during the crash.It does not report an error, it just exits and I can see that it didn't closed right from the exit codes. But here is the error log anyway:Quote:'Ether.exe': Loaded 'C:\Users\Steven\Desktop\Ether\Debug\Ether.exe', Symbols loaded.'Ether.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\user32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\secur32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\oleacc.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\d3d10.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\d3d10core.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\dxgi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\version.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\D3DX10d_39.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\PhysXLoader.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\IPHLPAPI.DLL''Ether.exe': Loaded 'C:\Windows\SysWOW64\dhcpcsvc.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\dnsapi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\winnsi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\dhcpcsvc6.dll''Ether.exe': Loaded 'C:\Users\Steven\Desktop\Ether\NxCharacter.dll''Ether.exe': Loaded 'C:\Program Files (x86)\Lua\5.1\lua5.1.dll', Binary was not built with debug information.'Ether.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.3053_none_d08d7bba442a9b36\msvcr80.dll''Ether.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcp90d.dll''Ether.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcr90d.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\shimeng.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\apphelp.dll''Ether.exe': Loaded 'C:\Windows\AppPatch\AcLayers.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\userenv.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\winspool.drv''Ether.exe': Loaded 'C:\Windows\SysWOW64\mpr.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll''Ether.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\imagehlp.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\setupapi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\D3D10SDKLayers.DLL''Ether.exe': Loaded 'C:\Windows\SysWOW64\nvwgf2um.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\D3DCompiler_39.dll''Ether.exe': Loaded 'C:\Program Files (x86)\AGEIA Technologies\v2.8.1\PhysXCore.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\physxcudart_20.dll', Binary was not built with debug information.'Ether.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\PhysXDevice.dll', Binary was not built with debug information.'Ether.exe': Loaded 'C:\Windows\SysWOW64\nvcuda.dll', Binary was not built with debug information.'Ether.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\nvapi.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\nvcuda.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\opengl32.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\ddraw.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\dciman32.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\glu32.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\PhysXDevice.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\PhysXDevice.dll', Binary was not built with debug information.'Ether.exe': Loaded 'C:\Windows\SysWOW64\nvcuda.dll', Binary was not built with debug information.'Ether.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\nvcuda.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\opengl32.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\ddraw.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\dciman32.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\glu32.dll''Ether.exe': Unloaded 'C:\Windows\SysWOW64\PhysXDevice.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\nvcuda.dll', Binary was not built with debug information.'Ether.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\PhysXDevice.dll', Binary was not built with debug information.'Ether.exe': Unloaded 'C:\Windows\SysWOW64\PhysXDevice.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\nlaapi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\NapiNSP.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\pnrpnsp.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\mswsock.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\winrnr.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\Wldap32.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\rasadhlp.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\WSHTCPIP.DLL''Ether.exe': Loaded 'C:\Program Files (x86)\AGEIA Technologies\v2.8.1\PhysXCooking.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\wsock32.dll'D3DX10: (INFO) Using AMD optimizations'Ether.exe': Loaded 'C:\Windows\SysWOW64\d3d10_1.dll''Ether.exe': Loaded 'C:\Windows\SysWOW64\d3d10_1core.dll'The thread 'Win32 Thread' (0x2170) has exited with code 1 (0x1).The thread 'Win32 Thread' (0x1aac) has exited with code 1 (0x1).The thread 'Win32 Thread' (0x21e0) has exited with code 1 (0x1).The thread 'Win32 Thread' (0x2164) has exited with code 1 (0x1).The thread 'Win32 Thread' (0x21cc) has exited with code 1 (0x1).The thread 'Win32 Thread' (0x2098) has exited with code 1 (0x1).The program '[8404] Ether.exe: Native' has exited with code 1 (0x1).;  Try stepping through the code in the debugger and see if you can pinpoint the location of the crash. (Yeah, I know that's no picnic in Lua, but sometimes you have to bite the bullet [smile] )   ;  You cannot use char *s for strings when interfacing with lua. Lua has no concept of char *s, and so strings can be reallocated all over the place.Try using std::strings, and see how that works for you.   ;Quote:Original post by bobofjoeYou cannot use char *s for strings when interfacing with lua. Lua has no concept of char *s, and so strings can be reallocated all over the place.Try using std::strings, and see how that works for you.Yep that was the problem but it's strange to me that I'm allowed to use const char* in the functions but not in the classes... Well anyway thanks man!   