-
I would like to use actix web from a common dependency but i have an error as below Here is my project tree
the pub use actix_files; the mod external_libs;
pub use external_libs::*; the cargo.toml file in common dir [package]
name = "common"
[dependencies]
actix-web = "^4.3" the cargo file in project dir members = ["app/"] the cargo file in project dir [package]
name = "app"
[dependencies]
common = { path = "../../common/" } and the lib.rs in app dir use common::actix_web;
#[actix_web::main]
async fn main() -> Result<()> {
....
} Rust analyzer can jump inside Actix web so looks like the dependency can be find but the compiler fails.... Could someone help me please? T_T |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
This comment has been hidden.
This comment has been hidden.
-
Macros can't resolve dependencies like this. You'll need to:
|
Beta Was this translation helpful? Give feedback.
-
thanks a lot @robjtede ^^ btw how can i use the |
Beta Was this translation helpful? Give feedback.
-
but i have another issue this the get attribute macro @robjtede |
Beta Was this translation helpful? Give feedback.
Macros can't resolve dependencies like this. You'll need to:
#[::common::actix_web::rt::main(system = "::common::actix_web::rt::System")]