Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

stodge

Errors with Luabind bindings

This topic is 5289 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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_<LogManager>("LogManager")
.def(luabind::constructor<>())
.def("getSingleton", &LogManager::getSingleton)
];

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!