wyleu
September 4, 2022, 6:33pm
2
Been trying to use the rtmidi crate on a Pi4 not had a lot of success…
It gets past the syntax check after some hand cranking…
opened 04:21PM - 04 Jul 21 UTC
Hello,
thanks for this library which I find pretty interesting because I consid… ered writing it myself before finding yours !
I tried to compile a simple example project but building failed. This is the backtrace :
``` Compiling rtmidi v0.2.0
error: failed to run custom build command for `rtmidi v0.2.0`
Caused by:
process didn't exit successfully: `/home/partage/.scripts/rust/rtmidi/target/debug/build/rtmidi-0c2e706d61bdb0f5/build-script-build` (exit status: 101)
--- stdout
cargo:rustc-link-lib=rtmidi
cargo:rerun-if-changed=wrapper.h
cargo:rerun-if-env-changed=RTMIDI_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rustc-cfg=rtmidi_version="v4_0_0"
--- stderr
wrapper.h:3:10: fatal error: 'rtmidi_c.h' file not found
wrapper.h:3:10: fatal error: 'rtmidi_c.h' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', /home/philippe/.cargo/registry/src/github.com-1ecc6299db9ec823/rtmidi-0.2.0/build.rs:41:10
stack backtrace:
0: rust_begin_unwind
at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:92:14
2: core::result::unwrap_failed
at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/result.rs:1355:5
3: core::result::Result<T,E>::expect
at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/result.rs:997:23
4: build_script_build::main
at ./build.rs:36:20
5: core::ops::function::FnOnce::call_once
at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```
My questions are:
- is the C++ lib supposed to be compiled before compiling the wrapper?
- where should be the C++ files (and the binary)?
but fails on compile
complaints of missing .so.5 files and no version available…
wyleu
September 5, 2022, 1:11pm
3
And that’s that one solved …
wyleu@rasppidesk:~/duopiano/rust_duo_piano $ LD_LIBRARY_PATH=/usr/local/lib cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.14s
Running target/debug/rust_duo_piano
There are 2 MIDI input sources available.
Input Port #1: Midi Through:Midi Through Port-0 14:0
Input Port #2: GENERAL:GENERAL MIDI 1 32:0
There are 2 MIDI output ports available.
Output Port #1: Midi Through:Midi Through Port-0 14:0
Output Port #2: GENERAL:GENERAL MIDI 1 32:0
That GENERAL MIDI is the DUO piano…
This has taken about a week…
main.rs (851 Bytes)
I’m really feeling quite smug…