Latest Posts

Topic: Building WL on win 10

hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 429
Ranking
Tribe Member
Location: Bavaria
Posted at: 2018-08-15, 00:03

Hi everybody,
after I finally got my Win 10 Building environment running I want to quickly share what to do. Well it is quite simple:
1. Download MSYS2 from http://www.msys2.org/ (just choose the version for your OS 64bit or 32bit)
2. Install it to the default path C:\msys64
3. Follow their update procedure. (pacman -Syu close and repeat pacman -Syu)
4. install mingw64 toolchain (or mingw32 toolchain) using pacman -S mingw-w64-x86_64-toolchain (for 64bit builds other wise use mingw-w64-i686-toolchain)
5. install all dependencies. I just took the commands which are used in the appveyor script. (pacman --noconfirm -S mingw-w64-%MINGWSUFFIX%-ninja mingw-w64-%MINGWSUFFIX%-boost mingw-w64-%MINGWSUFFIX%-SDL2_ttf mingw-w64-%MINGWSUFFIX%-SDL2_mixer mingw-w64-%MINGWSUFFIX%-SDL2_image mingw-w64-%MINGWSUFFIX%-glbinding) (replace MINGWSUFFIX either with i686 for 32bit or x86_64 for 64bit.)
6. I used glew so I installed glew using pacman in the same way as above. As we need cmake install it using pacman as well (pacman -S mingw-w64-x86_64-cmake)
7. Download the boost 1.66 package from http://repo.msys2.org/mingw
8. Use pacman -U <boost 1.66="" package_name=""> to downgrade boost. (1.67 doesn't work due to a change in random generator functions of boost).
9. Use the mingw64 bit shell of msys, navigate to your build folder (msys64/home/username/Widelands in my case)
10 . run cmake ( cmake -G "Ninja" -DCMAKE_C_COMPILER=C:/msys64/mingw64/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/msys64/mingw64/bin/g++.exe -DCMAKE_BUILD_TYPE=Release -DOPTION_USE_GLBINDING=OFF -DOPTION_BUILD_WEBSITE_TOOLS=OFF -DOPTION_ASAN=OFF D:/development/widelands-repo/mines-worldsavior) be sure to use linux path syntax
11. run ninja
12. You are done. Widelands.exe is in the src directory of your build folder</boost>

If I have time (after my short holiday)I would enter this to the wiki deleting the description of the unsucsessful attempt using ubuntu for windows if there are no objections.

Edited: 2018-08-16, 15:43
Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1523
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-08-15, 10:28

Regarding boost:

I am on archlinux with boost version 1.67.0-7 and have no problems. But every time a major update to boost happen, compiling does not work anymore as usual. I have to delete the build folder and compile from scratch again. Maybe you could try that also?

Didn't remember exactly, but i think an update of ICU needs the same solution.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 429
Ranking
Tribe Member
Location: Bavaria
Posted at: 2018-08-15, 16:30

The problem is that boost 1.67 tries to use some bcrypt libraries from the OS which are not included in WIN10.
BTW appveyor stays with 1.66 as well which direktes ne finally in the right direction.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 2626
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-08-16, 08:37

Please add the instructions to https://wl.widelands.org/wiki/BuildingWidelandsUnderWindowsNew/. I have created a new section "Building with MSys2 only" for you.

The procedure would be the same for Windows 7, so the page with the Ubuntu variant has a misleading title.


Busy indexing nil values

Top Quote
Arty
Avatar
Joined: 2018-08-03, 12:14
Posts: 20
Ranking
Pry about Widelands
Posted at: 2018-08-16, 14:55

Hm....I am having some trouble with this. Trying to do this exactly on Windows 7 for 64bit.

First minor issue I ran into was that cmake wasn't installed this way, so I also ran "pacman -Sy cmake". So far so good.

Now, trying to run cmake results in two errors:

  The CMAKE_C_COMPILER:

    C:/msys64/mingw64/bin/gcc.exe

  is not a full path and was not found in the PATH.
...
  The CMAKE_CXX_COMPILER:

    C:/msys64/mingw64/bin/g++.exe

  is not a full path and was not found in the PATH.

I am a bit of a loss here. How much more of "a full path" can it be? Maybe the error message is misleading though. Maybe I am even just overlooking something trivial here. Any thoughts?


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 429
Ranking
Tribe Member
Location: Bavaria
Posted at: 2018-08-16, 15:38

Have you tried searching for gcc.exe and adopting the path accordingly.
Where did you install MSYS ?
Perhaps you could try to add your mingw folder to the path variable of the OS.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 429
Ranking
Tribe Member
Location: Bavaria
Posted at: 2018-08-16, 15:45

I had forgotten cmake. Thanks I edited the first post to reflect this.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 429
Ranking
Tribe Member
Location: Bavaria
Posted at: 2018-08-16, 15:45

I Think there is a typo in my instructions. It should read gcc-toolchain I think. Can't check this though. As I am AFK from my dev machine. Could you check whether this solves the problem?

Edited: 2018-08-16, 15:49
Top Quote
Arty
Avatar
Joined: 2018-08-03, 12:14
Posts: 20
Ranking
Pry about Widelands
Posted at: 2018-08-16, 17:23

hessenfarmer wrote:

I Think there is a typo in my instructions. It should read gcc-toolchain I think. Can't check this though. As I am AFK from my dev machine. Could you check whether this solves the problem?

No, that was fine to begin with. It's all part of the mingw toolchain.

hessenfarmer wrote:

Have you tried searching for gcc.exe and adopting the path accordingly.
Where did you install MSYS ?
Perhaps you could try to add your mingw folder to the path variable of the OS.

Sorry, I forgot to mention this. I had checked the directory of course. The files (gcc.exe and g++.exe) are there, it's exactly the right path. That's why those error messages bother me so much.

But I found the error now. Should not have just run pacman -S cmake but the proper pacman -S mingw-w64-x86_64-cmake. That did the trick.

Now I am getting some other error, but don't have the time right now to check it out. Thanks for the help so far.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 429
Ranking
Tribe Member
Location: Bavaria
Posted at: 2018-08-16, 17:43

You're welcome. Keep us informed though.


Top Quote