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

Kaguya on Linux ? #53

Closed
Sygmei opened this issue Sep 30, 2016 · 8 comments
Closed

Kaguya on Linux ? #53

Sygmei opened this issue Sep 30, 2016 · 8 comments

Comments

@Sygmei
Copy link

Sygmei commented Sep 30, 2016

Has your lib been tested on Linux :) ?
It works perfectly on Windows but I want to pass a string as parameter on Linux is says :

maybe...Argument mismatch:GameObject,string,string,string candidate is: GameObject,std::__cxx11::basic_string<char, std::char_traits<char> std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>n std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>n std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>n std::allocator<char> >,

But basically, a std::__cxx11::basic_string<char, std::char_traits<char> std::allocator<char> > IS a string.
Is it cause of Lua or Kaguya ?

@satoren
Copy link
Owner

satoren commented Oct 1, 2016

Tested on Linux by travis-ci
https://travis-ci.org/satoren/kaguya
Can you write minimal code for error case?

@satoren
Copy link
Owner

satoren commented Oct 2, 2016

Look like require GameObject and 4 strings, but arguments is GameObject and 3 strings.

@Sygmei
Copy link
Author

Sygmei commented Oct 3, 2016

You were right, the problem is that the last string is supposed to be facultative in C++ It works on Windows (cause Lua seems to send default nil as parameter). On Linux it doesn't work :(

satoren added a commit that referenced this issue Oct 3, 2016
satoren added a commit that referenced this issue Oct 3, 2016
@satoren
Copy link
Owner

satoren commented Oct 3, 2016

It will error if the argument is not enough. Even Windows(MSVC 2008~2015).
https://ci.appveyor.com/project/satoren/kaguya/build/1.0.681

@Sygmei
Copy link
Author

Sygmei commented Oct 5, 2016

Okay, you were right, it doesn't work on the current version of Kaguya, it worked on Windows because I had an older version of Kaguya which passed null arguments when not provided (empty strings, zeros, empty lists etc...).
Is there a way to enable this feature again or even better : use C++ default arguments ? (Even if it's not possible to detect them in function header, maybe providing them again while binding the function)

@Sygmei
Copy link
Author

Sygmei commented Oct 5, 2016

It works now on Linux using an older version of Kaguya.

Another strange thing on Linux is the type of custom Objects :
type(obj) gives :
On Windows : kaguya_object_type_class mse::Script::GameObject
On Linux : kaguya_object_type_PN3mse6Script10GameObjectE
obj is a userdata from C++

Is it cause of Lua or Kaguya ?

@satoren
Copy link
Owner

satoren commented Oct 5, 2016

Older version is demangle not supported. support at 402765b

Default parameter is supported. #17

@Sygmei
Copy link
Author

Sygmei commented Oct 5, 2016

Well, thanks a lot, now everything is working under both Windows AND Linux :)
Continue the good work :)

@Sygmei Sygmei closed this as completed Oct 5, 2016
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