Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to call obj functions with std::string arguments #141

Open
madeso opened this issue Jan 1, 2016 · 1 comment
Open

Unable to call obj functions with std::string arguments #141

madeso opened this issue Jan 1, 2016 · 1 comment

Comments

@madeso
Copy link

madeso commented Jan 1, 2016

bool getdog(const std::string& dog);
getdog("dog") // works

int Foo::DoubleAdd(int y);
foo.double_add(3) // works

void Obj::faildog(const std::string& dog);
obj:faildog("dog") // C++ argument is dog "\x5\x1", expected a lua error
obj.faildog("dog") // [string "obj.faildog("dog")"]:1: bad argument #1 to 'faildog' (unregistered type expected, got string)

Visual Studio 2015 on windows + lua 5.3.2, if it matters

Full test sample:
https://github.com/madeso/selene-test/blob/master/test_obj.cc

@madeso madeso changed the title unable to call obj functions with std::string arguments Unable to call obj functions with std::string arguments Jan 1, 2016
@KatekovAnton
Copy link

replace
void Obj::faildog(const std::string& dog);
with
void Obj::faildog(std::string dog);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants