diesel_cli does not build

Created on 11 Mar 2018  路  4Comments  路  Source: diesel-rs/diesel

cargo install diesel_cli --verbose reports:

= note: /usr/bin/ld: cannot find -lpq
/usr/bin/ld: cannot find -lmysqlclient

Most helpful comment

Install diesel_cli on ubuntu

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

All 4 comments

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)

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?

Install diesel_cli on ubuntu

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

orionz picture orionz  路  3Comments

qmx picture qmx  路  3Comments

killercup picture killercup  路  4Comments

Fuckoffee picture Fuckoffee  路  3Comments

raintears picture raintears  路  4Comments