[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Symbol not found error using embedded Lua interpreter in Rust
- From: Deepak Jois <deepak.jois@...>
- Date: Wed, 21 Jun 2017 13:26:38 +0530
I am trying to use [rust-lua53](https://github.com/jcmoyer/rust-lua53)
to execute Lua code. _rust-lua53_ already bundles the source code for
Lua 5.3.3, and provides some bindings on top of it.
It seems to run fine with regular Lua code, but when I try to load a
Lua C module, it gives a "Symbol not found" error.
The Lua code I am trying to execute is:
```
print('hello')
if not pcall(function() require('serpent') end) then
print('error loading serpent')
else
spt = require('serpent')
print('serpent successfully loaded')
end
local status, err = pcall(function() require('lfs') end)
print(err)
```
which ends up giving the following output (on OS X, but I get
something similar on Linux):
```
hello
serpent successfully loaded
error loading module 'lfs' from file
'/Users/deepak/Downloads/lua53/lib/lua/5.3/lfs.so':
dlopen(/Users/deepak/Downloads/lua53/lib/lua/5.3/lfs.so, 6):
Symbol not found: _lua_settable
Referenced from: /Users/deepak/Downloads/lua53/lib/lua/5.3/lfs.so
Expected in: flat namespace
in /Users/deepak/Downloads/lua53/lib/lua/5.3/lfs.so
```
Could somebody help me understand where I can start troubleshooting
this? What does the Lua interpreter look for when trying to load a Lua
C module? Is there a specific way to link the Lua code inside of Rust
so that the symbols are available to the C module?
The full error report is here: https://github.com/jcmoyer/rust-lua53/issues/85
Thanks
Deepak