I have a canister which is importing two other canisters using:
#[ic_cdk_macros::import(canister = "environments_db")]
struct EnvironmentsDatabaseCanister;
#[ic_cdk_macros::import(canister = "user_profile_backend")]
struct UserProfileCanister;
In the environments_db canister I’m importing the Principal struct while in user_profile_backend I’m not. However, when I try building the project I get this error:
error[E0428]: the name `principal` is defined multiple times
--> src/omnia_backend/src/lib.rs:26:1
|
3 | #[ic_cdk_macros::import(canister = "user_profile_backend")]
| ----------------------------------------------------------- previous definition of the type `principal` here
...
26 | #[ic_cdk_macros::import(canister = "environments_db")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `principal` redefined here
|
= note: `principal` must be defined only once in the type namespace of this module
= note: this error originates in the attribute macro `ic_cdk_macros::import` (in Nightly builds, run with -Z macro-backtrace for more info)
The only imports that I’m using in both imported canisters are ic_cdk::api::call::ManualReply and candid::CandidType.
Any idea why this is happening?