decimad / luabind-deboostified

Create Lua bindings for your C++ code easily - my improvements
http://www.vrac.iastate.edu/vancegroup/docs/luabind/
Other
70 stars 27 forks source link

runtime error when calling lua function from C++, passing a const char* #14

Closed TrianglesPCT closed 8 years ago

TrianglesPCT commented 9 years ago

Trying to convert from luabind(the boost version) to this one, getting error at startup.

const char* path = "..\code\script\?.lua;" luabind::call_function(_State, "set_path",path);

It seems to be trying to find the class_id for "const char", not finding anything, and then reporting that const char is not a registered class.

" Trying to use unregistered class: char const *"

the-nic commented 9 years ago

I think there's simply missing a semicolon in the first line..

decimad commented 9 years ago

I can reproduce this behaviour. Working on a fix.

decimad commented 9 years ago

Added the missing string literal overload (latest commit). Pleare let me know if it works for you.

TrianglesPCT commented 9 years ago

the-nic: this was psuedo code, the real code was too complex to post, but yes it has a missing semi colon decimad: thx I'll give it a try

bagobor commented 8 years ago

I just tested master branch and std::string, const std::string&, and const char* works.

decimad commented 8 years ago

Great, thank you!