Two crates which depend on the libsqlite3-sys will link error in the same project.
rusqlite = { version = "0.32.1", default-features = false,features = ["bundled-sqlcipher-vendored-openssl"] } sqlx = { version = "0.8.2", features = ["runtime-tokio","tls-native-tls","sqlite"] }
The rusqlite and sqlx depend on the crate of libsqlite3-sys,if I add them in one project ,it will link error.
See #1393 which seems to suggest that both rusqlite and sqlx can coexist.
I guess your issue happens because you mix sqlcipher and sqlite.
i'm seeing this with rusqlite and refinery
[dependencies]
refinery = { version = "0.8.14", features = ["rusqlite"] }
rusqlite = "0.32.1"
error: failed to select a version for `libsqlite3-sys`.
... required by package `rusqlite v0.23.0`
... which satisfies dependency `rusqlite = ">=0.23, <=0.31"` of package `refinery-core v0.8.14`
... which satisfies dependency `refinery-core = "^0.8.14"` of package `refinery v0.8.14`
... which satisfies dependency `refinery = "^0.8.14"` of package `repository-sqlite v0.1.0 (/home/dan/Code/rust/stronger/repository-sqlite)`
versions that meet the requirements `^0.18.0` are: 0.18.0
the package `libsqlite3-sys` links to the native library `sqlite3`, but it conflicts with a previous package which links to `sqlite3` as well:
package `libsqlite3-sys v0.30.1`
... which satisfies dependency `libsqlite3-sys = "^0.30.1"` of package `rusqlite v0.32.1`
... which satisfies dependency `rusqlite = "^0.32.1"` of package `repository-sqlite v0.1.0 (/home/dan/Code/rust/stronger/repository-sqlite)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "sqlite3"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.
failed to select a version for `libsqlite3-sys` which could resolve this conflict
I have the same issue trying to use both sqlx and rusqlite, a guide on that would be highly appreciated.
There is an explanation here: https://youtu.be/pePqWoTnSmQ?list=PLqbS7AVVErFiWDOAVrPt7aYmnuuOLYvOa&t=1840