0

Unable to build ink! smart contract

My command:

cargo contract build --release

Issue:

attempted to define built-in macro more than once

/Users/xxx/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/macros/mod.rs:1423:5 | 1423 | macro_rules! cfg { | ^^^^^^^^^^^^^^^^ |

note: previously defined here --> /Users/xxx/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/macros/mod.rs:1423:5 | 1423 | macro_rules! cfg { | ^^^^^^^^^^^^^^^^

...

duplicate lang item in crate core

My Rust version:

installed targets for active toolchain

aarch64-apple-darwin

wasm32-unknown-unknown

active toolchain

stable-aarch64-apple-darwin (default)

rustc 1.75.0 (82e1608df 2023-12-21)

cargo-contract version:

cargo-contract-contract 3.2.0-unknown-aarch64-apple-darwin

1

1 Answer 1

0

The issue was resolved

Because Rust version is incompatible with ink! version and open-brush version

It should be:

  • rustc - 1.72
  • ink! - 4.2.0
  • open-brush - 4.0.0-beta

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.