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

Don't forget the Windows SDK! #1468

Merged
merged 1 commit into from
Jul 28, 2018
Merged

Don't forget the Windows SDK! #1468

merged 1 commit into from
Jul 28, 2018

Conversation

retep998
Copy link
Member

So many people encounter issues with Rust not working because they forgot this crucial bit.

So many people encounter issues with Rust not working because they forgot this crucial bit.
@Diggsey
Copy link
Contributor

Diggsey commented Jul 28, 2018

Thanks - do you know which parts of the windows SDK are actually required? It seems like I can build and run programs just fine without the windows SDK if I bypass the check here...

@Diggsey Diggsey merged commit f546c2b into rust-lang:master Jul 28, 2018
@retep998
Copy link
Member Author

retep998 commented Jul 28, 2018

@Diggsey How are you able to build programs without the Windows SDK? Any program that targets pc-windows-msvc relies on the import libraries provided by the Windows SDK in order to be linked. How else are you getting kernel32.lib if not somewhere in C:\Program Files (x86)\Windows Kits\10\Lib?

@Diggsey
Copy link
Contributor

Diggsey commented Jul 28, 2018

I found I only needed the Universal CRT to build a basic hello world.

(Specifically C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x64\ucrt.lib)

This is the linker invocation used to build my program (spaced out for ease of reading):

"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.10.25017\\bin\\HostX64\\x64\\link.exe"

"/NOLOGO" "/NXCOMPAT"

"/LIBPATH:C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib"

"main.main0.rcgu.o" "main.main1.rcgu.o" "main.main2.rcgu.o" "main.main3.rcgu.o" "main.main4.rcgu.o" "main.main5.rcgu.o"

"/OUT:main.exe"

"main.crate.allocator.rcgu.o"

"/OPT:REF,NOICF" "/DEBUG"

"/NATVIS:C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis"
"/NATVIS:C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis"
"/NATVIS:C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis"

"/LIBPATH:C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib"

"C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-5a84268e1656e5b2.rlib"
"C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-6893dd59ced296ba.rlib"
"C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-779d1daac75b7c75.rlib"
"C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-bd4c51f3f11697d9.rlib"
"C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc_system-a46105bc1c996454.rlib"
"C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-effc0948276bf472.rlib"
"C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-d66ca06c9d97b8e0.rlib"
"C:\\Users\\diggs\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-dcf8c600282ba3a7.rlib"

"advapi32.lib" "ws2_32.lib" "userenv.lib" "shell32.lib" "msvcrt.lib"

Not sure where or if it is getting those libraries, as I moved out everything except ucrt.lib.

@retep998
Copy link
Member Author

@Diggsey Are you sure you're not pulling in perhaps stuff from C:\Program Files (x86)\Windows Kits\8.1\Lib? What does your LIB environment variable have? advapi32.lib is one of those libraries that you have to get some version of the Windows SDK in order to get.

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

Successfully merging this pull request may close these issues.

3 participants