cargo install diesel_cli --verbose reports:
= note: /usr/bin/ld: cannot find -lpq
/usr/bin/ld: cannot find -lmysqlclient
You either need to install libpq-dev
, libmysqlclient-dev
or tell cargo not to compile diesel with those two backends with cargo install diesel_cli --no-default-features --features sqlite
.
(Packages names depend on your distribution, they might be different. I'm pretty sure those are right for debian)
See https://github.com/diesel-rs/diesel/blob/master/guide_drafts/backend_installation.md if you need more help.
I have this error, I'm using WSL2 and Ubuntu20.04
= note: /usr/bin/ld: cannot find -lsqlite3
/usr/bin/ld: cannot find -lpq
/usr/bin/ld: cannot find -lmysqlclient
collect2: error: ld returned 1 exit status
error: aborting due to previous error
Can you tell me all the packages that I need to install first?
Fix the issue this way:
`
sudo apt-get install libmysqlclient-dev
sudo apt install libpq-dev
sudo apt install libmariadbclient-dev-compat
sudo apt install libsqlite3-dev
`
Then
`
cargo install diesel_cli
`
It works for ubuntu 18, and 20
cc: @DaveRustvelt @gutsle
Most helpful comment
Install diesel_cli on ubuntu
Fix the issue this way:
`
`
Then
`
It works for ubuntu 18, and 20
cc: @DaveRustvelt @gutsle