From 2931373ff542e52ea9fcb6eba3479c0f3ebbe724 Mon Sep 17 00:00:00 2001 From: OpenMindTeh <113535446+OpenMindTeh@users.noreply.github.com> Date: Tue, 13 Jan 2026 12:48:40 +0300 Subject: [PATCH] fix: add no-entrypoint feature to spl-token dependencies to resolve linker conflict When building examples, the linker fails with multiple definition of entrypoint error because both spl-token and spl-token-2022 define the entrypoint() function by default. Error: error: ld returned 1 exit status multiple definition of 'entrypoint' spl_token-*.rlib: previous definition here This SDK is an off-chain client library, not an on-chain program deployed to validators. The entrypoint() function is only needed for on-chain Solana programs. Client libraries only need the types and structs for parsing account data. Fix: Add no-entrypoint feature to exclude the entrypoint symbol from compilation. Before: spl-token = "9.0.0" spl-token-2022 = "10.0.0" After: spl-token = { version = "9.0.0", default-features = false, features = ["no-entrypoint"] } spl-token-2022 = { version = "10.0.0", default-features = false, features = ["no-entrypoint"] } --- Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 702ef7a..76263ef 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,10 +68,10 @@ crossbeam = "0.8.4" crossbeam-queue = "0.3.12" parking_lot = "0.12.5" wide = "1.1.0" -spl-token = "9.0.0" -spl-token-2022 = "10.0.0" +spl-token = { version = "9.0.0", default-features = false, features = ["no-entrypoint"] } +spl-token-2022 = { version = "10.0.0", default-features = false, features = ["no-entrypoint"] } solana-commitment-config = { version = "3.1.0", features = ["serde"] } tonic-prost = "0.14.2" [dev-dependencies] -criterion = { version = "0.8.1", features = ["html_reports"] } \ No newline at end of file +criterion = { version = "0.8.1", features = ["html_reports"] }