Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Add HowTo for using the msys2 toolchain in README
Browse files Browse the repository at this point in the history
Explain how to install the msys2 toolchain as an alternative to using
wingw-w64 with a GTK distribution.  Also add a note about how to
correctly install Rust so there is no conflict with the linker provided
by rust.
  • Loading branch information
rnestler committed Jan 2, 2016
1 parent bf38259 commit a6bd09a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,48 @@ __gtk__ expects __GTK+__, __GLib__ and __Cairo__ development files to be install

### Windows

Make sure you have the [GNU
ABI](https://www.rust-lang.org/downloads.html#win-foot) version of the rust
compiler installed. Since we need our own toolchain make sure to uncheck
"Linker and platform libraries" in the Rust setup.
![Screenshot](rust_setup.png)

If you already installed Rust, check if your Rust installation has `gcc.exe`
and `ld.exe` in its `bin` directory. In that case remove those executables,
they will be provided by mingw instead. If you won't you'll probably get a
linking error `ld: cannot find -limm32`.

For the toolchain one has two possibilities:
1. Install msys2 with a mingw toolchain and the gtk3 package
2. Install the mingw-w64 toolchain separately and then install a GTK+ SDK

#### 1. msys2 toolchain

This method is recommended according to the [GTK+ project]
(http://www.gtk.org/download/windows.php). You can follow [this guide]
(https://blogs.gnome.org/nacho/2014/08/01/how-to-build-your-gtk-application-on-windows/)
or follow this steps:

- Install and update [msys2](https://msys2.github.io/)
- Install the mingw toolchain
```
$ pacman -S mingw-w64-x86_64-toolchain
```
- Install the gtk3 package
```
$ pacman -S mingw-w64-x86_64-gtk3
```

#### 2. separate mingw toolchain

Install [mingw-w64](http://mingw-w64.yaxm.org/) (select the win32 threading model) and download a __GTK+__ SDK:
* The GNOME project has [official distributions](http://win32builder.gnome.org/) of GTK+ 3.4 upto 3.10
* The GNOME project hosts [distributions](http://win32builder.gnome.org/) of GTK+ 3.4 upto 3.10
* [GTK+ for Windows Runtime Environment Installer: 64-bit](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer) supports GTK+ 3.14, its SDK downloads can currently be found [here](http://lvserver.ugent.be/gtk-win64/sdk/).

Make sure both mingw's and the sdk's `bin` directories are in your `PATH` e.g. (assuming mingw is installed in `C:\mingw-w64` and the SDK unpacked into `C:\gtk`)
```
C:\> set PATH="C:\mingw-w64\bin;C:\gtk\bin;%PATH%"
```
If your Rust installation has `gcc.exe` and `ld.exe` in its `bin` directory, you may
get a linking error `ld: cannot find -limm32`. In that case remove those executables,
they will be provided by mingw instead.

## Versions

Expand Down
Binary file added rust_setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a6bd09a

Please sign in to comment.