-
Notifications
You must be signed in to change notification settings - Fork 71
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
Fail to execute simple Lua code with kaguya #57
Comments
Hi, I don't get it error. but look like slightly different for C api and kaguya code. Could you try it with code like the one below? Match completely code with your C api code.
If you do not want global to dirty.
or
|
Hi, Thanks for this quick answer. I tried your code sample, all three version of it (thanks for the alternatives by the way) and it's still the same. There must be some incompatibility with some of my toolchain's component I guess but which one ... |
Hi What is tool chain? |
A toolchain is a set of utilities used for programming. It ensures among other things that your "tools" are compatible with each other. I'm sorry for this "confused" explanation, I'd suggest to check it out on the internet for a better one it is definitely worth to know what it is. I doubt I'm using a different lua_State with the C api than with Kaguya since both are using the same headers and library (I obviously might have forgotten something so please, feel free to suggest any idea). As for the _ENV I just quickly googled it but I have to admit I didn't get exactly what it was or what it was used for, let alone how I could be using a different one. Thanks for your help |
Hi,
I've tried to compile and run some simple code using kaguya.
I compiled the same code twice, first with my system binary and
libraries (64 bits archlinux up to date) and then with a toolchain
for 32 bits x86.
In both cases the compilation is successful, my problem is when I run
the version compiled with the toolchain I get an error : "attempt to index a nil value"
(which I don't get with the version compiled directly with my system).
I tried to replicate the code logic using only the lua C api and then compiled
it again with my system binary and libraries then with the toolchain. In this
case both binaries works as expected.
My system uses g++ 6.2.1 while the toolchain is using g++ 4.9.2 (both meeting kaguya
requirements). I'm compiling with the std=c++11 option.
My system uses lua 5.3.3 while the toolchain uses 5.2.2
Here is the code which get me the "attempt to index a nil value" error :
And here is the equivalent with the C api which does not trigger any error.
I've tried modifying scriptAdding2CppVariables (in the code version using kaguaya) to
"return 1 + 2" and removed the statements to export the variables a and b into the lua
context but I still get the same error. It leaves us with only 3 statements using lua.
Commenting the call to luaFunc() does stop the error from occurring.
If anyone could tell me why I got this behavior I'd be grateful.
Thanks
The text was updated successfully, but these errors were encountered: