Skip to content
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

fresh install on Windows 10, simple program gets linker error. #30319

Closed
Nuclearfossil opened this issue Dec 11, 2015 · 8 comments
Closed

fresh install on Windows 10, simple program gets linker error. #30319

Nuclearfossil opened this issue Dec 11, 2015 · 8 comments

Comments

@Nuclearfossil
Copy link

Installation of Rust 1.5 on windows 10 machine via this link: https://static.rust-lang.org/dist/rust-1.5.0-x86_64-pc-windows-msvc.msi

Visual Studio 2013 and 2015 are already installed as well as the associated Visual Studio extensions for Rust.

Generate a simple test program, as follows:

helloworld.rs

fn main()
{
    println!("Hello World!");
}

Running rustc through the new rust shell as follows:

rustc helloworld.rs

emits the following:

D:\dev\rust\helloworld>rustc helloworld.rs
error: linking with `link.exe` failed: exit code: 1181
note: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC/bin\\amd64\\link.exe" "/LIBPATH:C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC/lib\\amd64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.10586.0\\ucrt\\x64" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib" "helloworld.0.o" "/OUT:helloworld.exe" "/OPT:REF,ICF" "/DEBUG" "/LIBPATH:C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib" "/LIBPATH:D:\\dev\\rust\\helloworld\\.rust\\bin\\x86_64-pc-windows-msvc" "/LIBPATH:D:\\dev\\rust\\helloworld\\bin\\x86_64-pc-windows-msvc" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcollections-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_unicode-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\librand-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc_system-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-35c36e89.rlib" "ws2_32.lib" "userenv.lib" "advapi32.lib" "kernel32.lib" "shell32.lib" "msvcrt.lib" "compiler-rt.lib"
note: LINK : fatal error LNK1181: cannot open input file 'ws2_32.lib'

error: aborting due to previous error

Any ideas?

@retep998
Copy link
Member

Duplicate of #30229

@alexcrichton
Copy link
Member

Indeed this is a dupe, thanks for the report though!

@Nuclearfossil
Copy link
Author

No worries. I did do a search looking for those symptoms. Apparently my google-fu was weak yesterday.

@TomasHubelbauer
Copy link
Contributor

@Nuclearfossil Did you actually resolve this? I followed the link to issue #30229 and then to this pull request. The way I understood it it was only necessary to run the vcvars64.bat file and things should work, so I did that, restarted Visual Studio (I also installed Rust through the MSVC MSI and am using the Rust extension for Visual Studio) and it didn't help. I'm getting the same error. Any pointers?

What sucks is that I don't get to use Rust at all this way, because cargo install for the first time attempts to update the registry which leads to it wanting to compile things which fails for the same reason.

@Nuclearfossil
Copy link
Author

I've actually given up on Rust on the win32/64 platform for the time being.

On Sat, 26 Mar 2016 at 03:07 Tomáš Hübelbauer notifications@github.com
wrote:

@Nuclearfossil https://github.com/Nuclearfossil Did you actually
resolve this? I followed the link to issue #30229
#30229 and then to pull request
#135 #135. The way I understood
it it was only necessary to run the vcvars64.bat file and things should
work, so I did that, restarted Visual Studio (I also installed Rust through
the MSVC MSI and am using the Rust extension for Visual Studio) and it
didn't help. I'm getting the same error. A ny pointers?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#30319 (comment)

@TomasHubelbauer
Copy link
Contributor

Thanks for the reply. :)

@qtamaki
Copy link

qtamaki commented Nov 15, 2017

I try add component "C++/CLI Support" by VS2017 installer.

@retep998
Copy link
Member

@qtamaki
"C++/CLI Support" is not the component you want. That merely installs Managed C++ which is very different from the native C++ toolchain that Rust relies on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants