-
Notifications
You must be signed in to change notification settings - Fork 892
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.exe problem on Windows 10 #1455
Comments
I remember installing 2017.
…On July 5, 2018 8:03:06 AM PDT, cswinter ***@***.***> wrote:
@AaronM04 What version of the build tools did you install?
I think Rust specifically requires the Visual C++ Build Tools 2015
which seem hard to come by these days (see
#1454)
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1455 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
@cswinter I'm not 100% certain, but I suppose it works with the latest 2017 build tools for me. |
@AaronM04 well, /nologo is msvc option and the commands you posted link against Windows core libraries. So those cannot be correct options for GNU either. |
You should use the msvc toolchain as default toolchain to use the Visual C++ build tools. |
This is definitely a path problem. Make sure you don't have a conflicting |
Thanks for the help everyone. I fixed this by:
|
What VS dependency do I need to add to get link.exe? I see closed issues, but no solution. Can someone please offer a link to the correct VC++ version? |
Rust does not blindly invoke When using the Visual Studio Installer please make sure you have at least one of the |
I have an issue with VS 2019 Preview 3.0 - on the laptop, rust is not able to find link.exe, while on the desktop it can. I can build fine from the x64 Prompt, but not from the command line. |
@ajess33 |
Hi, I think this problem still exists. I can get cargo to compile and link in the x64 Native Tools Command Prompt as long as I add all the paths but it doesn't work in Powershell generating the same linker error as described above. |
@edwaugh its not clear that you have the same issue - per discord, after you rebooted to activate path, vs works fine, cmd works fine, but powershell invocations aren't working correctly. Whatever the issue is, I don't think it is within rustup: rustup has correctly added to PATH, and it's proxies seem to be doing the right thing as far as we can tell. |
For people who want to spare time and brain cells, here is how to compile a rust program in clean Windows installation: Press Win key, search for "powershell", launch <# install package manager #>
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
<# install vs shit and rust with ms abi. you may need to reboot afterwards #>
choco install visualstudio2019buildtools visualstudio2019-workload-vctools rust-ms -y --force
<# add built rust software path #>
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";C:\Users\" + $env:USERNAME + "\.cargo\bin", "User")
<# populate env with new binaries installed with package manager and path updates. you need to restart pwsh if this doesn't work #>
refreshenv
<# install pwsh script to import env vars from cmd bat into pwsh, see next command #>
Install-Module -Name WintellectPowerShell -Scope CurrentUser -Confirm:$false -Force -AllowClobber
<# import env vars with paths into pwsh. you need to do this every time you start new pwsh and want to compile rust software #>
Invoke-CmdScript 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat' You should now be able compile, install and use whatever Rust software you want:
|
My PATH was different but this solution worked for me. Thank you!!!! |
Hi all, I installed the MS C++ Build Tools as requested by rustup-init.exe and rebooted, but I am unable to build a hello world app with cargo:
It appears that it's running the GNU link command rather than the MSVC one. Could this be a path problem? Here is my path:
The text was updated successfully, but these errors were encountered: