Rust errors / Build and Cargo
Rust build error · checked with Rust 1.99.0
links to the native library
error: failed to select a version for `libsqlite3-sys`... the package `libsqlite3-sys` links to the native library `sqlite3`, but it conflicts with a previous package which links to `sqlite3` as well
What it meansTwo versions of a crate that links a native C library ended up in your tree. Cargo allows only one crate per native library.
Why it happens
- rusqlite and sqlx (or two versions of either) needing different libsqlite3-sys versions.
- Two major versions of openssl-sys, git2 or similar.
How to fix it
1. Find the two versions
cargo tree -i libsqlite3-sys2. Make both dependents agree
Upgrade or downgrade one of them until both accept the same version of the native-linking crate.
Other wordings of this error
links to the native library, conflicts with a previous package which links to, only one package in the dependency graph may specify the same links value
Other build errors
- error: linker `link.exe` not found
- error: linker `cc` not found
- error: failed to run custom build command for `openssl-sys`
- error: failed to select a version for the requirement
- error: could not compile `my-crate` (bin "my-crate") due to 1 previous error
- error: package `foo v1.2.3` cannot be built because it requires rustc 1.80 or newer, while
- feature `edition2024` is required
- Blocking waiting for file lock on package cache
Up next
Find the right pagePaste any Rust errorCompiler codes and build errors in one finder.Read it next →Also worth your time
Did this answer your question?