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

I'm can't run cargo install diesel-cli --no-default-features --features mysql on windows 10 with MSVC2017 #1768

Closed
raintears opened this Issue Jun 27, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@raintears

raintears commented Jun 27, 2018

I met with a lot of errors but I read the thread only to realize we have to add some environment variables etc but I can't find any help on this issue. It's complaining about some linking error? Can someone help me? I'm on windows 10.

error: linking with C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX64\x64\link.exe failed: exit code: 1120

@weiznich

This comment has been minimized.

Contributor

weiznich commented Jun 28, 2018

That sounds like something is wrong with your mysql setup. (I would guess libmysqlclient is missing)

See the documentation of mysqlclient-sys (the crate we use for the mysql stuff) for details how to setup the environment.

I close this issue because this is nothing actionable that could be fixed inside of diesel.
Feel free to use our Gitter channel for further questions or response to this issue.

@weiznich weiznich closed this Jun 28, 2018

@raintears

This comment has been minimized.

raintears commented Jun 29, 2018

It's not missing. I installed it. The error happens when compiling diesel_cli

process didn't exit successfully: rustc --crate-name diesel src/main.rs --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg feature="diesel" --cfg feature="infer_schema_internals" --cfg feature="mysql" --cfg feature="url" -C metadata=bd285b008eff2313 -C extra-filename=-bd285b008eff2313 --out-dir C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps -L dependency=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps --extern chrono=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps\libchrono-f54516ef2a593f2a.rlib --extern clap=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps\libclap-ffeb0d5cc824d05e.rlib --extern diesel=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps\libdiesel-8e2a4e63564e5e36.rlib --extern dotenv=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps\libdotenv-465a041bb598e52f.rlib --extern infer_schema_internals=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps\libinfer_schema_internals-66920efbc5fb48bd.rlib --extern migrations_internals=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps\libmigrations_internals-b921a11ae77a4dc7.rlib --extern serde=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps\libserde-875d5ac5f162a2ac.rlib --extern tempfile=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps\libtempfile-6ad149e0e7ddb7cb.rlib --extern toml=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps\libtoml-48cd27bfc099e7e9.rlib --extern url=C:\Users\user\AppData\Local\Temp\cargo-installFKeB7q\release\deps\liburl-2f98437d64aca106.rlib --cap-lints allow -L native=C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib\vs14 (exit code: 101)

@weiznich

This comment has been minimized.

Contributor

weiznich commented Jun 29, 2018

It's not missing. I installed it. The error happens when compiling diesel_cli

That error is clearly a linker error. This means: (ordered by likelihood)

  • libmysqlclient is not installed
  • libmysqlclient is not found by the linker. See the Readme from mysqlclient-sys for details how to tell the linker where to search
  • libmysqlclient is incompatible with your linker (32bit vs 64bit for example)
@raintears

This comment has been minimized.

raintears commented Jul 2, 2018

1st case: I installed MySQL Connector/C 8.0 via Windows Installer.
2nd case: It found my libmysqlclient -> linking with C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX64\x64\link.exe failed: exit code: 1181
3rd case: Ok I gave up. Nothing helps in mysqlclient-sys. I use 32 bit and 64 bit both gives me the same error.

This entire process is not even found in the docs.

I went with postgres instead and it gives me yet another fatal error LNK1181: cannot open input file 'libpq.lib'

This was working fine with mac but now on windows is like a whack. Nothing works. The getting started guide only works for mac, it breaks in windows.

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