Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upfailed to compile `diesel_cli v0.6.1`./usr/bin/ld: cannot find -lpq, cannot find -lsqlite3 #321
Comments
This comment has been minimized.
|
Most of the time If you're not looking for sqlite support, you should install diesel_cli with cargo install diesel_cli --no-default-features --features postgreswhich won't compile the sqlite libs. If you do want sqlite support, you'll also need to install sqlite on your machine. |
This comment has been minimized.
fuyingfuying
commented
May 10, 2016
|
@mcasper pg_config is installed to /usr/bin/pg_config in my machine. And it is on my $PATH. But the error still exists. fuying@fuying-linux:~$ echo $PATH
/home/fuying/.multirust/toolchains/nightly/cargo/bin:/home/fuying/.multirust/toolchains/nightly/bin:/home/fuying/.cargo/bin:/usr/lib/postgresql/9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games |
This comment has been minimized.
|
Do you also have libpq installed? |
This comment has been minimized.
mann-ed
commented
May 11, 2016
|
I had the same issue. I found that my postgresql lib was under /usr/pgsql-9.3/lib/. So i symlink the libpq.so.5 to /usr/lib/libpq.so sudo ln -s /usr/pgsql-9.3/lib/libpq.so.5 /usr/lib/libpq.so Then it compiled just fine. I'm on Fedora and have postgresql93-libs installed. Hope that helps. |
This comment has been minimized.
fuyingfuying
commented
May 11, 2016
This comment has been minimized.
fuyingfuying
commented
May 11, 2016
|
@mann-ed Use your method, and it works, Thanks for your help |
fuyingfuying
closed this
May 11, 2016
This comment has been minimized.
|
I do want to see if we can improve this scenario, as it's a common stumbling point. Can you tell me what the output of |
This comment has been minimized.
fuyingfuying
commented
May 15, 2016
•
|
@sgrif fuying@fuying-linux:~$ pg_config --libdir
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
|
This comment has been minimized.
|
@fuyingfuying In #321 (comment) you said it was... Anyway that looks like the root of the problem here, and the message given is definitely the correct solution. I'll see if I can improve the error message in pq-sys when pg_config isn't installed |
fuyingfuying
reopened this
May 15, 2016
fuyingfuying
closed this
May 15, 2016
This comment has been minimized.
fuyingfuying
commented
May 15, 2016
|
@sgrif |
This comment has been minimized.
xahon
commented
Jan 13, 2018
|
I just stucked into the same error. I had already installed libpq5 and libmysqlclient20 on my pc. Solution was |
AyushyaChitransh
referenced this issue
Mar 31, 2018
Closed
"cargo install diesel_cli" fails with a generic overflow on latest nightly #1450
This comment has been minimized.
alejandrotamayo
commented
Jun 6, 2018
|
@mann-ed method worked for me in linux mint. |
fuyingfuying commentedMay 10, 2016
•
edited
Hi, I'm very love rust and very interesting in your project. Currently I'm building a simulation training system using iron, diesel and other rust crates. But when I try to install diesel_cli followed your "getting start" doc, using "cargo install diesel_cli" in bash. But it failed:

I've noticed this issue: #286. But how can make sure pg_config is on the path, or libpq is in /usr/local/include or some other path that ld can see.
I'm using ubuntu 15.10, postgresql and sqlite3 have been installed. libpq and libsqlite3 are in path "/usr/lib/x86_64-linux-gnu".
My "/etc/ld.so.conf"are:
My "/etc/ld.so.conf.d/x86_64-linux-gnu.conf" are:
So, how can i solve this problem, thank you!