c++ - How to get Luabind properties to work? -
i trying utilize luabind's properties when importing class. definitions correct, of sure, when phone call upon property, such print if it's string or number, this
function: 009ec440
now have no thought why happening, have looked around on net , have found several people same problem. should build luabind these parameters:
bjam toolset=msvc-9.0 variant=debug threading=multi link=shared define=_bind_to_current_vclibs_version
now have tried this, still same error. thing note using msvc 2012, have tried build toolset=msvc-11.0, 1 time again no avail. have read need define luabind_dynamic_link if not using boost build build project, have done right before include of luabind. has still caused error. have tried build luabind myself, have run problem linking raises many symbol errors (i not sure define luabind_dynamic_link, if knows might prepare problem). know how prepare issue?
here code declaring properties:
luabind::module(luastate)[ luabind::class_<weapon>("weapon") .def(luabind::constructor<float, float>()) .def_readwrite("onfire", &weapon::onfirefunc) .def_readonly("modifier", &weapon::modifier) ];
and attempting accessed so, weapon beingness instance of weapon class declared it's constructor:
print(weapon.modifier) weapon.onfire = onfire
statically linking works, create work dynamic linking, using these parameters:
bjam toolset=msvc-9.0 variant=debug threading=multi link=static define=_bind_to_current_vclibs_version
i had same problem on vs2008. (this 6 mos after post, may help else)
i fixed adding luabind_dynamic_link preprocessor directive.
project->properties->c/c++->preprocessor
add luabind_dynamic_link list of preprocessor definitions.
i built luabind using same bjam command have @ top of post.
c++ luabind
No comments:
Post a Comment