Skip to content

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

Closed
blairn opened this issue Nov 4, 2014 · 4 comments
Closed

Using Rust on windows install guide will lead you to a bad bad place. #18617

blairn opened this issue Nov 4, 2014 · 4 comments
Labels
O-windows Operating system: Windows

Comments

@blairn
Copy link

blairn commented Nov 4, 2014

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

  1. put them in our install?
  2. put in an installer so we can grab them
  3. Put in the documentation how to grab the mingw libraries you will be linking to if you are building on windows because you are needing to build an app there.
    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.

@thestinger
Copy link
Contributor

or 4) find a way to remove ourselves from having to use mingw for everything on windows.

The alternative is having to use Visual Studio for everything, which would be more painful.

@thestinger thestinger added A-docs O-windows Operating system: Windows labels Nov 4, 2014
@klutzy
Copy link
Contributor

klutzy commented Nov 4, 2014

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.
If you want to link to gdi32 or other libraries which bundle doesn't have, you must install mingw-w64 as described here.

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

@blairn
Copy link
Author

blairn commented Nov 5, 2014

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?

@blairn
Copy link
Author

blairn commented Nov 11, 2014

#18797 fixes this....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

3 participants