LUA trouble: Try to call the global ‘unpack’ (zero value)

I am relatively new to Lua, and I am trying to embed it in the library. I can execute the script from the command line, but I get the following error when I call the function in the script when embedding

PANIC: unprotected error in call to Lua API ([string "-- #! /usr/local/bin/lua..."]:72: attempt to call global'unpack' (a nil value))

Where did the packing go?

You may embed Lua as source code instead of as a pre-built library. In this case You may not enable backward compatibility.

By default, the command line interpreter has backward compatibility, so you see the difference.

I am relatively new to Lua, and I am trying to embed it in the library. I can execute the script from the command line, but I encounter the following error when calling the function in the script when embedding

PANIC: unprotected error in call to Lua API ([string "-- #! /usr/local/bin/lua..."]:72: attempt to call global'unpack '(a nil value))

Where did you pack it?

You may embed Lua as source code instead of as a pre-built library. In this case, you may not enable backward compatibility. < p>

By default, the command line interpreter has backward compatibility, so you see the difference.

Leave a Comment

Your email address will not be published.