Open deepakjois opened 7 years ago
On Linux, when I put this is my .cargo/config
file, things work fine and the Lua C module loads successfully:
[build]
rustflags = ["-C", "link-args=-Wl,-export-dynamic"]
After doing a little bit more research it appears that a more cross-platform solution is putting this in .cargo/config
[build]
rustflags = ["-C", "link-args=-rdynamic"]
Discovered this via a tip here: https://stackoverflow.com/questions/34082636/expose-symbols-to-dynamic-linker-when-linking-with-native-library-in-rust
I installed LuaRocks modules
serpent
(regular Lua module) andluafilesystem
(Lua C Module) inside my Lua environment, and then tried to run this modified hello.rs file.The error I get is:
I am also tracking this at jcmoyer/rust-lua53#85. It is most likely an issue with the Rust linker not exporting the Lua symbols properly so that a Lua .so module can see it.
I will continue to investigate this, but if you know of any ways to solve this, please do comment.