![rust for windows rust for windows](https://www.wepc.com/wp-content/uploads/2022/02/Rust-1-1200x900.jpg)
- Rust for windows .exe#
- Rust for windows install#
- Rust for windows full#
- Rust for windows windows 10#
exe file in sight! It took me an embarassingly large amount of time to get the idea to run the linking command manually: error: linking with `D:\RustProjs\hello-w98\linker.cmd` failed: exit code: 1103 Now it looks like it has linked the files successfully, but there is no. cargo/config file: target = "i586-pc-windows-msvc " linker = 'D:\RustProjs\hello-w98\linker.cmd ' # show the linker command line rustflags = To tell cargo to use another linker, we can add a.
![rust for windows rust for windows](https://cdn.mos.cms.futurecdn.net/9LYHPZ22BX6ERzjs9pmyYM.jpg)
![rust for windows rust for windows](https://docs.microsoft.com/en-us/windows/images/rust-rss-reader-2.png)
In order to configure the MSVC environment just for the linker call, I have created a linker.cmd batch file: echo off
Rust for windows full#
I think it has something to do with the full vsvars32.bat config, but I did not feel like debugging it further, so I have tried to use the old linker (and libs) only.Ĭalling link.exe without the vsvars32.bat environment does not output anything and just exits with an error code. To make sure that the project always uses our own toolchain, the default has to be overridden: rustup override set win98Īfter confirming that the toolchain works by building with the default MSVC tooling ( cargo run -target i586-pc-windows-msvc), I have tried building again, but this time from within the vsvars32.bat development environment: cmdĬargo build -target i586-pc-windows-msvcīut nope! For some reason Rust/Cargo tries to pass in the x86_64-pc-windows-msvc library object files, so link.exe rightfully errors with: fatal error LNK1112: module machine type 'X86' conflicts with target machine type '圆4' In order to use the fresh new toolchain, we have to tell rustup about it: rustup toolchain link win98 D:\RustProjs\rust\build\x86_64-pc-windows-msvc\stage1įirst of all, I've created a new binary crate/project and changed the Hello, world! to Hello, Windows 98!, of course. Props to the people that wrote the extensive documentation inside of and online, making the build not much harder than your regular ol' Rust crate!
Rust for windows install#
Some scoop install python, setting the correct host and target in the config.toml, and python x.py build -i -stage 1 src/libstd later, Rust and all the dependencies began compiling! After 26 Minutes and 18 Gigabytes the stage 1 compiler and standard library for x86_64-pc-windows-msvc and i586-pc-windows-msvc have been built! Since I was sure that some tinkering with rustc and/or the standard library will be necessary, I've checked out the Rust repo. I've copied it and altered all the paths to point to the correct locations on my host machine. The toolset includes a handful of batch files like vsvars32.bat, setting the proper paths and variables automatically.
Rust for windows windows 10#
A quick Windows 10 VM and Visual Studio installation later, I've copied the whole Microsoft Visual Studio 8 folder over to my host machine, knowing from previous endeavours that the CLI tools in Microsoft's C/C++ toolset are pretty much portable, as long as the environment variables are set correctly. Prerequisites (link) Visual C++ Toolset (link)Īfter a quick search online it seems that the Visual C++ 2005 toolset is the last one that officially supports building for Windows 98. Some inspiration also came from C# running on Windows 3.11. My retro Windows of choice is Windows 98 Second Edition, so that is what I have settled for as the initial target for this project. So, for fun, I wanted to try compiling a binary that works on similarly old systems.
![rust for windows rust for windows](https://cdn.pixabay.com/photo/2020/07/08/07/22/windows-5382936_960_720.jpg)
This target disables SSE2 support and only emits instructions available on the original Intel Pentium from 1993. Tl dr: It actually works, mostly! See the conclusion down below.ĭid you know that Rust has a Tier 2 target called i586-pc-windows-msvc? I didn't either, until a few days ago. Posted: Compiling Rust binaries for Windows 98 SE and more: a journeyĭiscussion on /r/rust, HN, Rust user forum