Email me

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-sys

2. 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

Up next

Find the right pagePaste any Rust errorCompiler codes and build errors in one finder.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ