-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Using Rust on windows install guide will lead you to a bad bad place. #18617
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
Comments
The alternative is having to use Visual Studio for everything, which would be more painful. |
Windows nightlies contains gcc bundle, but the bundle doesn't contain all libraries from mingw(-w64) at the time. For example (as you noticed) it doesn't contain gdi32. Right, the current status is in flux and not user-friendly; we need concrete plan and detailed documents about bundle and mingw-w64 installation. cc #18325 |
Sadly, it is pointing to a version of mingw which can not be installed. There is a bug report which say the problem is fixed in the last 5 days (it has been broken since July), but I can't find where to get the non broken installer ( I don't think it is as fixed as they think it is). http://sourceforge.net/p/mingw-w64/bugs/413/ This right here is the problem. Before I didn't know which version to install.... now I know which version, but it still doesn't help me at all. I like Rust when it is on Linux, however the windows install of it just isn't ready for general use, you don't get cargo by default, and mingw is currently it's own special kind of hell. I know there is a plan to bundle cargo, can we bundle a more complete mingw as well? |
#18797 fixes this.... |
https://github.com/rust-lang/rust/wiki/Using-Rust-on-Windows is very incomplete... or rather, it will direct people into a minefield (eventually).
The problem is, you don't have all the libraries that would normally come with a mingw install. So the moment you want to link into... say... gdi32 then unless you are a c++ programmer, and know what is about to happen, things will go badly for you.
This is because you will need a copy of libgdi32.a, and there is MANY wrong ways of getting this file.
You COULD install mingw to get it... in which case, if you pick the wrong version (which - there are many to choose from) you will stop being able to compile anything, as it will use the new mingw install over the one inside the Rust installed directory.
Even then, say you realize what has gone wrong.. which is not easy given errors like...
C:\projects\myproj\target\myproj.o: file not recognized: File format not recognized collect2.exe: error: ld returned 1 exit status
and remove the install of mingw (or at least move it). You still need to grab the libgdi32.a file from it and put it into the \users%user%.rust directory so rust will find it. I'm not sure that is documented anywhere.
even then, chances are... you will get a
ld: skipping incompatible C:\Users\myuser.rust\libgdi32.a when searching for -lgdi32
and still fail to build.
My guess is you need an exact version match of mingw to get the normally used windows libraries to link to.
Can we either
or 4) find a way to remove ourselves from having to use mingw for everything on windows.
All of the document you can find around these problems on the net are all c++ things, and given we have a built in mingw, they are all wrong.
The text was updated successfully, but these errors were encountered: