pixix4 / ev3dev-lang-rust

Rust language bindings for http://ev3dev.org
MIT License
71 stars 14 forks source link

How can you use the derive macros from a crate that is not inside the library workspace? #8

Closed Seppel3210 closed 3 years ago

Seppel3210 commented 3 years ago

I always get a error: cannot find derive macro Device in this scope

pixix4 commented 3 years ago

I am not quite sure what you're trying to achieve. Usually you don't need to use the Device macro manually. If you really need to use it, try to import and allow macros from the derive crate explicitly.

// main.rs

#[macro_use]
extern crate ev3dev_lang_rust_derive;
Seppel3210 commented 3 years ago

Yeah the thing was that I didn't clone the repository and when declaring extern crate ev3dev_lang_rust_derive; it says that it can't find the crate (obviously). My question was if I could use the macros without cloning the repository (sorry that I did't really make that clear).

Seppel3210 commented 3 years ago

oh... I forgot to define the dependeny in Cargo.toml. I feel dumb