New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link/Libpq Error during diesel_cli compilation #1454

Closed
EloD10 opened this Issue Jan 6, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@EloD10
Contributor

EloD10 commented Jan 6, 2018

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!

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 6, 2018

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

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 6, 2018

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

@EloD10

This comment has been minimized.

Contributor

EloD10 commented Jan 6, 2018

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 =)

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 6, 2018

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 sgrif closed this Jan 6, 2018

EloD10 added a commit to EloD10/diesel that referenced this issue Jan 7, 2018

Update backend_installation.md
Refer to this issue diesel-rs#1454

This described how to install PostgreSQL in Windows.
@top1st

This comment has been minimized.

top1st commented Nov 8, 2018

@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?

@weiznich

This comment has been minimized.

Contributor

weiznich commented Nov 8, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment