Diesel: Link/Libpq Error during diesel_cli compilation

Created on 6 Jan 2018  路  6Comments  路  Source: diesel-rs/diesel

Versions

  • Rust:
    nightly-x86_64-pc-windows-msvc
    rustc 1.24.0-nightly (edbd7d232 2017-12-20)
  • Diesel:
    Diesel 1.0.0 with Diesel CLI v1.0.0
  • Database:
    PostgreSQL 10 (install with GUI installer)
  • Operating System
    Windows 10

Problem Description

I can't compile diesel_cli when i try this command : cargo install diesel_cli --no-default-features --features postgres.
The full error message : https://pastebin.com/vVRK3cxi

What are you trying to accomplish?

I have set PATH in user variables

C:\PostgreSQL\pg10\lib
C:\PostgreSQL\pg10\bin

Checklist

  • I have already looked over the #587, #843, etc some other issue/subissue

I know, some people already had this kind of errors in past but after some time, i don't find a solution =/

Thanks for your attention!

Most helpful comment

You should remove \lib from your path. You cannot statically link libpq with msvc. You only need the bin directory on your path.

All 6 comments

You should remove \lib from your path. You cannot statically link libpq with msvc. You only need the bin directory on your path.

You can also just run pg_env.bat which does all the setup needed for you.

Thank you a lot for your very fast response !
But me, i was long because i have do some test whitout succefull solution until I install PostgreSQL with EnterpriseDB installer (not BigSQL as i did). And finally with your instructions it works ! Thank you a lot ! <3

I think we should add these instructions in documentation, it can help some people =)

Feel free to open a pull request to https://github.com/diesel-rs/diesel/blob/master/guide_drafts/backend_installation.md with Windows steps that work for you. Unfortunately, I don't use Windows for development, so I'm not the best person to document how to link libpq on that platform.

@sgrif that backend_installation.md worked me for compile but not working well.
diesel setup 馃憤 works
diesel migration generate create_posts 馃憤 works
diesel migration run 馃憥 not works
diesel migration list 馃憥 not works
I follwed this link
https://diesel.rs/guides/getting-started/
why not works in windows?

@top1st Without saying what does not work nobody can and will help you.

Was this page helpful?
0 / 5 - 0 ratings