Error: linking with `cc` failed when installing Diesel-cli

Hey everyone,

I'm trying to install Diesel CLI `cargo install diesel_cli --features sqlite but its fails with the following error:

error: linking with `cc` failed: exit status: 1
..
= note: /usr/bin/ld: cannot find -lmysqlclient: No such file or directory
          /usr/bin/ld: cannot find -lsqlite3: No such file or directory
          collect2: error: ld returned 1 exit status
          

error: could not compile `diesel_cli` (bin "diesel") due to previous error
error: failed to compile `diesel_cli v2.1.1`, intermediate artifacts can be found at `/tmp/cargo-install9egh2B`.

`
What do I should to do?

Thanks in advance

See Installing Diesel CLI here.

I got to fix, following this step.

How I would like to install just slite feature cargo install diesel_cli --no-default-features --features sqlite and I could observe the error. /usr/bin/ld: cannot find -lsqlite3:

Then I debug ld using verbose mode ld -lsqlite3 --verbose and could see which it's trying to open libsqlite3.so, so looking for it using find / -name 'libsqlite3.so' 2>/dev/null and create ln -s /usr/lib/i386-linux-gnu/libsqlite3.so.0.8.6 /usr/lib/libsqlite3.so, installed again diesel-cli and bingo! Worked!

You are entering dangerous territory. You are probably breaking your OS installation by doing that. Please triple-check with your OS documentation how to deal with different library versions. In most linuxes, the so symlinks are managed by the packages manager and you will break it.

These symlinks are generally part of -dev or -devel packages.