Jump to content

Setting up the building environment under Windows 10


Recommended Posts

Initially, this thread began with this post called "Using Windows 10's Linux subsystem for development?" and indeed on the topic of WSL. Somehow, we got a bit OT, but I think that we went into the right direction, i.e. covering questions around how to set up the building environment under Windows 10 etc. Therefore, I have renamed this thread accordingly and hope to attract more interested users and also get further help from our pros here. Thanks to all of you! :)

--- snip ---

 

Hello!

Has anyone of you tried/tested Windows 10's Subsystem for Linux (WSL), e.g. Debian or Ubuntu, for development (well, mainly building)? It's CLI-only, AFAIK, and I wonder if the guidance e.g. there would still apply. Would you mind sharing your experience here? Thank you!

Edited by Ceres
Link to comment
Share on other sites

All I had to do was executing these 2 PowerShell commands invoked as admin:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

The 2nd line is optional (for the Virtual Machine Platform, for which your machine will require virtualization capabilities) and is only required if you want to use WSL2.

After this, a restart was needed and installation of the Linux kernel from there:

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

To set WSL2 as your default version for the installation of new Linux distributions, execute this PowerShell command (or skip this, if you want/need to leave it as WSL1):

wsl --set-default-version 2

After this, you can DL and install a Linux distro. There are a bunch available on the MS Store, e.g.:

Link to comment
Share on other sites

I agree that thus you have a cleaner and more stable environment. However, my attempts to have Win 10 and some Linux flavour in a dual-boot setup was always a hassle. As it was years ago, meantime this is perhaps easier. My recent experience is using Debian with Pihole and Unbound as DNS in a VM on a Synology server, which is very stable and reliable (incl. regular snapshots), but that's getting OT here.

If someone is still interested in the solution via WSL, please have a look there (from where I got the information from):

https://docs.microsoft.com/en-us/windows/wsl/install-win10

I have not yet built anything with this but will try and report here about my experiences with it. As usual for me, this might take longer than you think. :blush:

Link to comment
Share on other sites

Well, WSL2 does not work on one of my PCs (an Intel Core2 Duo), as starting Debian fails with:

Quote

Installation failed with error 0x80070003 or error 0x80370102

Explanation from MS:

Quote

WSL2 requires that your CPU supports the Second Level Address Translation (SLAT) feature, which was introduced in Intel Nehalem processors (Intel Core 1st Generation) and AMD Opteron. Older CPUs (such as the Intel Core 2 Duo) will not be able to run WSL2, even if the Virtual Machine Platform is successfully installed.

So I have to revert to WSL1.

Link to comment
Share on other sites

WSL1 indeed works on that machine. Now I read in the Wiki information about various standard tools and development libraries for Linux. Can somebody please help me to translate that long list to a matching command like apt install xxx for Debian buster? Thank you so much!

Quote
  • a C++17 conforming compiler
  • LLVM-objdump, which is part of the LLVM binaries. You don't need clang itself.
  • the rust compiler and cargo (NB: A24 needs rust 1.49, 1.50 and later won't work without patching)
  • Boost (at least 1.57 since r21726)
  • CMake (only needed if you use bundled NVTT)
  • Python 2.7 (required for cxxtest and non-system SpiderMonkey 45)
  • libcurl (at least 7.32)
  • libenet (1.3, the older 1.2 is not compatible)
  • libfmt (at least 4.0)
  • libgloox (needed for the lobby; at least 1.0.10, previous versions are know to have connection problems; pass --without-lobby to update-workspaces.sh to exclude the lobby)
  • libicu
  • libogg
  • libpng
  • libsodium (>= 1.0.14, follow the instructions at https://download.libsodium.org/doc/installation/ if your distro is behind)
  • libvorbis
  • libxml2
  • miniupnpc (at least 1.6)
  • OpenAL
  • OpenGL
  • SDL2 (at least 2.0.2)
  • Subversion (or git if you want to use the Git mirror; see below)
  • zlib

What is a "C++17 conforming compiler"?

Regarding LVVM, I did an 'apt install lvvm', and a bunch of packages were installed. I am not sure if that was just too much or if something is missing.

When I want to build a25, does the following still apply?

Quote

A24 needs rust 1.49, 1.50 and later won't work without patching)

Oh, BTW, rust is not found in Debian buster, but rustc, rust-gdb, rust-lldb, and some other stuff.

Hmm, I feel like building 0 A.D. in Windows 10 with VC might be easier for me (as I was successful with this already). Maybe I leave the WSL excourse...

Edited by Ceres
Link to comment
Share on other sites

17 minutes ago, Ceres said:

Hmm, I feel like building 0 A.D. in Windows 10 with VC might be easier for me (as I was successful with this already). Maybe I leave the WSL excourse...

Wise choice. Windows 10 does cater for all you need to be a good 0ad dev, although the process might be a bit painful. feel free to check out my last youtube video on how to compile it in Windows 10. 

I have experimented with WSL 1 year ago and it did not provide a stable gui environement for me. Also the resolution was quite limited so I feel that it is not worth it. 

You can try virtualbox if you wish. 

  • Thanks 1
Link to comment
Share on other sites

Currently I don't see for me any advantage to deviate from Win 10. I will look into your video - thanks for it.

Could you maybe link it in the wiki for developers?

PS:

I used Virtual Box and even vSphere (bare metal) a couple of years ago. It was ok, but with my Synology DS920+ with 16 GB RAM (yes, it works with more than 8 GB) and Intel Celeron 4-core 2.0/2.7 GHz CPU, it's even more convenient. Still, I am no Linux expert. If Windows works (and currently, it does) to build, I am happy. :)

Edited by Ceres
Link to comment
Share on other sites

15 minutes ago, Ceres said:

Currently I don't see for me any advantage to deviate from Win 10. I will look into your video - thanks for it.

Could you maybe link it in the wiki for developers?

PS:

I used Virtual Box and even vSphere (bare metal) a couple of years ago. It was ok, but with my Synology DS920+ with 16 GB RAM (yes, it works with more than 8 GB) and Intel Celeron 4-core 2.0/2.7 GHz CPU, it's even more convenient. Still, I am no Linux expert. If Windows works (and currently, it does) to build, I am happy. :)

 

Of course you can use windows 10 for developing. You might run into a few errors while building atlas, but it is an easy fix: just rebuild without atlas and then copy atlasUI.dll into binaries/system folder. That should do the trick. 

  • Thanks 1
Link to comment
Share on other sites

Recommendations for Windows 10 devs:

1. Sublime text for editing xml files. It provides very good autocompletion and allows simultaneous editing of multiple files.

2. Use MultiCommander file explorer with the default one, because MultiCommander supports tabs in the same window so if you need to look at many folders simultaneously. 

 

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Ceres said:

I use Notepad++ and Total Commander

Nice tools! :D

Total Commander has been the first thing I install on a fresh system for decades; my license probably goes back to when it was called Windows Commander. (And for decades I mostly was too lazy to retrieve the license from my backups and just lived with the nag screen...)

  • Like 1
Link to comment
Share on other sites

Yep, I like them, too. :)I quickly had a look into Sublime and MultiCommander but found that Notepad++ and TotalCommander already satisfy my needs.

 

BTW, scoop is a nice package manager for Windows portables (and several non-portable apps). Yes, and there are very capable alternatives to this, too. ;)

 

PS - instructions to uninstall WSL etc.:

https://superuser.com/questions/1317883/completely-uninstall-the-subsystem-for-linux-on-win10

:D

Edited by Ceres
Link to comment
Share on other sites

Still a bit OT here, but as the problem and fix for building Atlas was kindly provided here by @Yekaterina, I would like to mention my below changes in the Wiki (see below in orange), reflecting this (along with the minor note about the difference key binding to build in VS 2017 vs. VS 2019). Please let me know, if it is not clear enough (or wrong), and I will be happy to amend it. Thank you.

Quote

Build configuration

Make sure to select the "Release" configuration to build an optimized, more playable version of the game (the target will be pyrogenesis.exe). The "Debug" configuration can be more useful for debugging but has significantly reduced performance (the target will be pyrogenesis_dbg.exe). Both "Release" and "Debug" builds include debug symbols, see Debugging and Debugging on Windows for more details on debugging.

Now you should be able to build the code from within Visual Studio, using "Build Solution" (F7 in VS 2017 and Ctrl+B in VS 2019).

Building Atlas

If you also wish to test the Atlas Scenario Editor or Actor Editor tools, you will need to download and build the wxWidgets library separately (version 3.0 and above; see ps\libraries\win32\wxwidgets\README.txt for details), then supply the --atlas option when running update-workspaces.bat. Atlas projects will now be included when you open pyrogenesis.sln in Visual C++.

Note: You might run into a few errors while building Atlas. As an easy fix, after update-workspaces.bat, just rebuild without the --atlas parameter and then copy atlasUI.dll into the binaries/system folder [see forum post]

PS:

I found it too difficult for me to use VS 2019 and adhering to the notes when using this version. Instead, I will go back to VS 2017, which worked (for me) out of the box for building pyrogenesis.

There is an updated Visual Studio Community 2017 version 15.9 available, dated 11 May 2021 (besides the v15.0 from 11 Dec 2019):

https://my.visualstudio.com/Downloads?q=visual studio community 2017

 

Edited by Ceres
Link to comment
Share on other sites

48 minutes ago, Ceres said:

I found it too difficult for me to use VS 2019 and adhering to the notes when using this version

Not to mention the storage requirements. I ended up refactoring the code to compile it with vs2019. vs2021 is coming out soon.

Link to comment
Share on other sites

Maybe some detailed step-by-step instructions from installing VS 2019 and the required components*, setting the right stuff after opening the project, etc. would help? Currently, I have a show-stopper also with VS 2017, telling me that the project was unloaded, despite I deleted the VS2017 folder that was created by update-workspaces.bat. Admittedly, I have no clue about VS and what this all implies, i.e. I am the regular/usual Windows 10/Office user. :blush:

*EDIT: The VS (2017) installer tells me to load additional stuff that can be workloads, single components, etc. I don't even know that I have to select there. A couple of weeks/months ago, I seemed to have luck just by chance (but stupidly do not remember what I installed - should have noted it down).

When I go to Tools => Get Tools and Features, I get this message:

Quote

Unable to locate Visual Studio Installer

Despite I just started the installer (and switched from German to English language), and the installer file still sits on my desktop. Hmm...

Edited by Ceres
Link to comment
Share on other sites

I renamed this thread to "Setting up the building environment under Windows 10". ;)

 

Now I have completely uninstalled VS 2017 and will reinstall again. However, I wonder which version the correct one is:

  • Visual Studio Community 2017 (version 15.9)
  • Visual Studio Community 2017 (version 15.0)
Edited by Ceres
Link to comment
Share on other sites

  • Ceres changed the title to Setting up the building environment under Windows 10

What am I missing here?

1.png.c9138c2d2b70dc8f96eda8ed7b6e146e.png

 

I thought, the solution is to click "Install", but then I get this:

2.png.dc5eea9bbc2e43de8740908c8ca6627b.png

Why is it unable to locale the installer, which I just used to install VS 2017? The installer (vs_Community_15.9.exe) is clearly on my Desktop. :confused:

 

EDIT - try & error...

Obviously, it is not this one (sorry, despite I changed the language to English, the installer is still in German):

2.png.583713cefaac013ca4b0f08101b186ad.png

Because I still see this - all "unavailable", whatever that means.

I opened VS 2017 by double-clicking on .\0ad_svn\build\workspaces\vs2017\pyrogenesis.sln, assuming that thus, I open the project in VS. Isn't that correct?

 

Edited by Ceres
Link to comment
Share on other sites

Ok, now I understand which route to go - enter "compiler" in the search box of the VS 2017 v15.9 installer and see which components will be installed additionally. Thus, the projects do not appear "unavailable" anymore.

grafik.thumb.png.492613d08712505deea8c43fc9b31e58.png

If I see it correctly, I yet have to install the missing WindowsXP (v141_xp) platform toolset that is also mentioned in the Wiki.

grafik.png.77617380db8e5f834ebcce7c1febfa64.png

Must be this one, I guess (also mentioned in the Wiki):

https://www.microsoft.com/en-us/download/details.aspx?id=8279

Edited by Ceres
Link to comment
Share on other sites

But why is this all so complicated? The link in the Wiki leads to "Microsoft Windows SDK for Windows 7 and .NET Framework 4". Wouldn't we risk to trash our Win 10 installations? Does it also work if we installed the Windows 10 SDK (with .NET Framework 4 - caution, links to German installer) instead?

 

Edited by Ceres
Link to comment
Share on other sites

I think I give this up, too. It's all too complicated. Old tools/SDKs etc. to be installed on a current Win 10 system, not clear which components are the minimum requirements, and other hassle. If somebody else would like to keep this going, please feel free. Maybe I can edit the Wiki accordingly, but for the time being, it's just too frustrating for me to even set up the building environment. :(

  • Sad 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...