Compiling from source with Visual Studio 2019

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderators: Forum Moderators, Developers

Post Reply
RatchaTowns
Posts: 2
Joined: May 14th, 2020, 7:36 pm

Compiling from source with Visual Studio 2019

Post by RatchaTowns »

Hi, I'm a newbie looking to get into contributing code to Wesnoth for the first time after being a longtime player and lurker. This might not be the right place to put this, and if so, I'm sorry.

I am attempting to use the instructions here to compile the most recent source on Windows.

Try #1: Following instructions exactly:
I forked and cloned the wesnoth repo (to repos/wesnoth on my computer) and then cloned the external repo (to repos/external). I then added external/dll to the system path. I checked out the VC16 branch on the external repo. The wesnoth repo already had a VC16 folder, so I opened the wesnoth.sln in there with Visual Studio 2019. The solution loaded correctly. I then tried to build (configuration Release Win64).

This took almost no time at all and resulted in a lot of repetitions of "...wesnoth\src\boost-patched\bind\arg.hpp(3,10): fatal error C1083: Cannot open include file: 'boost/version.hpp': No such file or directory...". Liblua was the only project that successfully built.

Try #2: Adding paths directly to Visual Studio:
I noticed that the include directories and library directories for each project did not point to external/include and external/lib. So I added those paths to those settings manually and tried to build again (configuration Release Win64).

This approach successfully built an additional project (wesnothlib), but the other three still failed. I ended up getting these errors:
fatal error LNK1104: cannot open file 'libboost_date_time-vc142-mt-x64-1_70.lib'
fatal error LNK1104: cannot open file 'libboost_date_time-vc142-mt-x64-1_70.lib'
fatal error LNK1181: cannot open input file 'libpng16.lib'

As near as I can tell, these files are missing entirely from external/lib. There are close alternatives (libboost_date_time-vc142-mt-x32-1_70.lib and libpng16-16.lib), but no exact matches. I also got a lot of warnings about conversion from size_t to int or unsigned int.


What's happening here? Did I miss a step somewhere? Is my first contribution to the wesnoth project going to be updating these docs? I appreciate any insight you can give me

gfgtdf
Developer
Posts: 1312
Joined: February 10th, 2013, 2:25 pm

Re: Compiling from source with Visual Studio 2019

Post by gfgtdf »

Yes these docs seem outdated in particular the " external" tepp is afaik outdated and should no longer be used At least for 1.14 64bit builds, you should remove the external folder and just get everything needed via "vcpkg"
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

User avatar
Pentarctagon
Project Manager
Posts: 4376
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Compiling from source with Visual Studio 2019

Post by Pentarctagon »

I updated the wiki to match the steps we currently are using for the automated travis-ci Windows builds, so barring some oddity cropping up those steps should work for you as well.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

RatchaTowns
Posts: 2
Joined: May 14th, 2020, 7:36 pm

Re: Compiling from source with Visual Studio 2019

Post by RatchaTowns »

Thanks, I'll give it a shot!

Post Reply