helgoboss / reaper-rs

Rust bindings for the REAPER C++ API
MIT License
78 stars 8 forks source link

unresolved import `reaper_low::PluginContext` no `PluginContext` in the rootrustc #63

Closed sonictim closed 1 year ago

sonictim commented 1 year ago

I'm trying to get started with a reaper-rs extension. Admittedly, I'm a total noob to rust, so I am happy to chalk this up to operator error. I followed all the getting started instructions in the readme, however, when I copy and paste the sample extension code, I'm getting an error I can't figure out. It's loading reaper-low and reaper-medium, but it's not finding PluginContext and ReaperSession. Any advice would be greatly appreciated. Attaching a screenshot with the error....

Ideally, I'm looking to use reaper-medium API calls in a plugin extension similarly to C++

Screen Shot 2022-11-02 at 10 02 42 PM
sonictim commented 1 year ago

Solved for MAC OS Monterrey In the Reaper-RS getting started documentation, it recommends the following lines for the Cargo.toml

########################## [dependencies] reaper-low = "0.1.0" reaper-medium = "0.1.0" reaper-macros = "0.1.0"

[lib] name = "reaper_my_extension" crate-type = ["cdylib"]

##########################

THE ISSUE: When setting up dependencies in this fashion, Cargo looks to crates.io for these crates. According to the reaper-rs documentation, the reaper-rs crates on crates.io is out of date and not maintained. Instead, it is recommended to clone the git repository and work with the create locally.

SOLUTION: Under dependencies, you must instead point to the local path of the cloned reaper-rs repository. Below is an example Cargo.toml pointing instead to the reaper-rs directory

########################## [dependencies] reaper-low = {path = "/main/low"} reaper-medium = {path = "/main/medium"} reaper-macros = {path = "/main/macros"}

[lib] name = "reaper_my_extension" crate-type = ["cdylib"] ##########################

After pointing my dependencies to the correct local path, the base extension example code is able to compile. Hope this helps any fellow noobs like me trying to figure out how to get started...