Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

error ''undefigned symbol: lua_rawgetp'' while trying to bind a love project with rust

$
0
0

I have a love2d project where I am trying to bind midi controllers with rust and mlua rust library,I have this file configuration :

.├── conf.lua├── data/├── fonts/├── icon.png├── images/├── lib│├── bump/│├── discordRPC/│├── gamepadguesser/│└── midi_input_handler│├── Cargo.lock│├── Cargo.toml│├── libmidi_input_handler.so│├── makefile│├── src││├── lib.rs││└── midi_handler.rs│└── target│├── CACHEDIR.TAG│└── debug│├── build││├── alsa-sys-77e1bf3e25c0debe/││├── alsa-sys-b741dd268b3e925f/││├── libc-a02a8f1a1757eae3/││├── libc-c87ef9fe5c4c07ea/││├── mlua-sys-54611b35a16a6525/││├── mlua-sys-620da340fb195242/││├── num-traits-88de8cf05bbdf5ea/││├── num-traits-bc09a7d6340429b8/││├── proc-macro2-590fdbef782f5a29/││└── proc-macro2-c2a63acaec6ca8e8/│├── deps/│├── examples/.│├── incremental/│├── libmidi_input_handler.d│└── libmidi_input_handler.so├── main.lua├── makefile├── makelove.toml├── README.md├── scripts|   .│├── input││├── input_action_state.lua││├── input_button.lua││├── input.lua││├── input_midi.lua││├── input_profile.lua││└── input_user.lua|   .|   :├── sfx/└── test.toml

and lib.rs :

use crate::midi_handler::*;use mlua::prelude::*;use std::thread;//same name as the lib (path include...)#[mlua::lua_module] fn libmidi_input_handler(lua: &Lua) -> LuaResult<LuaTable> {lua_init(lua)}#[mlua::lua_module] fn target_debug_libmidi_input_handler(lua: &Lua) -> LuaResult<LuaTable> {lua_init(lua)}#[mlua::lua_module] fn libmidi_input_handler_libmidi_input_handler(lua: &Lua) -> LuaResult<LuaTable> {lua_init(lua)}#[mlua::lua_module] fn lib_midi_input_handler_libmidi_input_handler(lua: &Lua) -> LuaResult<LuaTable> {lua_init(lua)}#[mlua::lua_module]fn lua_init(lua: &Lua) -> LuaResult<LuaTable> {    let exports = lua.create_table()?;    exports.set("print_rust", lua.create_function(lua_print_rust)?)?;    exports.set("innit_midi", lua.create_function(lua_innit_midi)?)?;    Ok(exports)}//test functionfn lua_print_rust(_: &Lua, message: String) -> LuaResult<()> {    println!("[rust] {message}");    Ok(())}//function that I want to usefn lua_innit_midi(_: &Lua, _: ()) -> LuaResult<()> {    thread::spawn(|| {init();});    Ok(())}

when I do

local midi = require("lib.midi_input_handler.libmidi_input_handler")

In input_user.lua.I have this error message :

./lib/midi_input_handler/libmidi_input_handler.so: undefined symbol: lua_rawgetp

I tried to change my cargo.toml, but it did not change anything (my actual cargo.toml) :

[lib]crate-type = ["cdylib"][dependencies]midi-control = "0.2.2"midir = "0.10.0"mlua = { version = "0.9.7", features = ["lua54", "module"] }

(sorry for that much of code, I don't really know how to give enough element without giving that much)


Viewing all articles
Browse latest Browse all 12111

Trending Articles