Errors with Luabind bindings

Started by
1 comment, last by stodge 20 years, 2 months ago
I''m trying to write some Lua bindings for some Ogre classes using Luabind but I''m getting errors. My bindings are: luabind::module(L) [ luabind::class_("LogManager") .def(luabind::constructor<>()) luabind::def("getSingleton", &LogManager::getSingleton) ]; The error is: D:\Development\ogre\ogrenew\PlugIns\LuaScriptManager\src\LuaScriptManager.cpp(66) : error C2143: syntax error : missing '']'' before ''tag::id'' And I really don''t know why it won''t compile. Any suggestions? Also how would I create the defenition for a class with overloaded functions? I''ve tried so many things (and deleted the code in frustration). COuld someone post an example please? Thanks
---------------------http://www.stodge.net
Advertisement
could it be because of the luabind::def() call?
from looking at my code it seems that .def is a function for a class_<> object (btw, u appear to me missing the ''type'' of the class, althought that could be down to a loss of the < and > tags by the forum), so is should probably look like :

luabind::module(L)
[
luabind::class_&ltLogManager>("LogManager")
.def(luabind::constructor<>())
.def("getSingleton", &LogManager::getSingleton)
];
I think I already tried that one. I don''t actually need a binding for the constructor but this is the error I get with your code:

LuaScriptManager.cpp
..\luabind\luabind/class.hpp(1066) : error C2660: ''overload_rep::overload_rep'' : function does not take 2 parameters
..\luabind\luabind/class.hpp(1143) : see reference to function template instantiation ''void __cdecl luabind::class_ified>::internal_def_s::apply(const char *,class Ogre::LogManager &(__cdecl *)(void),struct luabind::class_base *)'' being compiled
Error executing cl.exe.

Thanks for your help.
---------------------http://www.stodge.net

This topic is closed to new replies.

Advertisement