Currently Online

Latest Posts

Topic: Building with Visual Studio

impactus
Avatar
Joined: 2021-04-12, 20:43
Posts: 16
Ranking
Pry about Widelands
Posted at: 2021-04-23, 16:50

Currently trying to get things going based on the very helpful guide in the wiki.

https://www.widelands.org/wiki/Building%20Widelands%20in%20Visual%20Studio/

I can already try to build it, with 4422 Warnings. Knowing what happened the last time I opened an older project in VS2019, I expect this is due to VS2019 being overly critical. Most of it is stuff like "conversion from 'size_t' to 'uint8_t', possible loss of data".

I also had two errors in sound_handler.cc. std::max was missing. So I put #include <algorithm> after windows.h in the _WIN32 ifdef. Fixed it.

Where I'm currently hitting a wall is the linker error "cannot open input file 'ssp.lib'". I was not able to find out what ssp is. There doesn't seem to be a source related to "ssp" and I can not find what external dependency this might be through google. Please help.

Update: I found the request for ssp in "WIFunctions.cmake", line 149. I removed it and was able to build widelands.exe. However, I wasn't able to run it, it just did nothing. Looking at a normal widelands installation, the exe needs to be next to the data folder, so i copied it from build\x64-Release-static to the repository's root folder. There, the exe opens a window for a very short time before quitting without any output. Although, after some more experiments, I think the window shows the cursor graphic before closing.

Now, I wouldn't be surprised if my modifications broke it. But I'm not entirely certain I just didn't give it the right environment. There doesn't seem to be documentation about this part of the process.


More feedback about the process so far:

I did indeed run into dependency chain problems like described in the troubleshooting section. Although I don't think it was mpg123. The fix was "vcpkg install yasm-tool:x86-windows" all the same. Although I did not use the triplet argument since I figured this out myself before reading the troubleshooting section.

Another tiny thing to note:

Rename libmpg123.lib -> mpg123.lib and zstd_static.lib -> zstd.lib in [vcpkg]/installed/x64-windows-static/lib and [vcpkg]/installed/x64-windows-static/debug/lib

this is imprecise. You are supposed to do this with the debug variants too, but those files are called differently, they end with d. As a result, it is unclear if the d should be removed or kept with the new filenames.

Edited: 2021-04-23, 19:51

Top Quote
impactus
Avatar
Joined: 2021-04-12, 20:43
Posts: 16
Ranking
Pry about Widelands
Posted at: 2021-04-24, 12:00

Is this not the right forum for this or something? Confused by the low number of posts here, and how the "technical help" forum seems to be used, since it's not in the development section.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2045
Ranking
One Elder of Players
Location: Germany
Posted at: 2021-04-24, 16:15

Well, this a forum, not a hotline face-wink.png

Probably no one who can help you has already seen your post. Maybe you can send a PM to matthiakl who creates the wiki article?

Or switch to another IDE, like QtCreator (requires the Qt library)?


Top Quote
impactus
Avatar
Joined: 2021-04-12, 20:43
Posts: 16
Ranking
Pry about Widelands
Posted at: 2021-04-24, 18:37

Yeah I get it, I didn't mean it that way. Maybe a bit, thought people would be more eager to get more devs. It also doesn't help that I asked in advance what is prefered for development, knowing what a shitshow basic setup usually is. Anyway, thanks for your reply. I just saw how quick related responses in the wrong(?) forum are. I assume the title didn't help, I just thought it would be more helpful once I get it going.

Anyway, thanks for the contact. But the thing is, at this point I'm basically looking for instructions how/where to run the executable. Maybe the data folder being there just isn't enough? Or maybe some experience what could be wrong if the game just opens to black with a cursor and closes without a word? Or where I could find an error log what went wrong?


Top Quote
tothxa
Avatar
Joined: 2021-03-24, 12:44
Posts: 51
Ranking
Likes to be here
Posted at: 2021-04-24, 19:34

Maybe there are just more (GNU/)Linux (*BSD?) users around... I guess it wouldn't be surprising for a free software / open source game.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2045
Ranking
One Elder of Players
Location: Germany
Posted at: 2021-04-24, 19:38

I have moved this topic to the forum Technical Help.

Related to the data folder: Have you tried the --datadir=/full/path/to/data/ switch?

Edited: 2021-04-24, 19:38

Top Quote
Atanase
Avatar
Joined: 2021-04-15, 13:33
Posts: 126
Ranking
At home in WL-forums
Location: Béarn (France)
Posted at: 2021-04-24, 19:40

If I can.....

Do you use Linux? Why do you want to use Visual Studio? Do you want to develop some new routines?


La connaissance ne vaut que si elle est partagée par le plus grand nombre.
---------------------------------------
Knowledge is only valuable if it is shared by the greatest number.

Top Quote
impactus
Avatar
Joined: 2021-04-12, 20:43
Posts: 16
Ranking
Pry about Widelands
Posted at: 2021-04-24, 21:00

Related to the data folder: Have you tried the --datadir=/full/path/to/data/ switch?

I just did. It was interesting, because it took a bit longer and it opened fullscreen. Before it opened a window as seems to be my configuration for playing the binaries i got from your site 2 weeks ago.

Do you use Linux? Why do you want to use Visual Studio? Do you want to develop some new routines?

Since no advice implied this was a linux project first, and given that it has to build for windows anyway, I decided to go with Visual Studio, as I have that going anyway. Really I was interested in getting things going as easy as possible, and the guide didn't seem too compicated. At least it was my choice after deciding for windows. I actually develop for linux as my day job, but I do that in a VM. I was afraid as a game it could lead to problems executing the build in a VM. Like, imagine the game just opens to a black screen and immediatly closes. Then what? face-grin.png

Oh well. Also cheers, it's Saturday night after all.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 1742
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-04-24, 21:32

Hi impactus,
building with Visual Studio does only work since a couple of months. And this is only possible for the work of one single person (matthiakl). However building for windows does work quite ok with MSYS2 environment. The good thing about this build envireonment is that it is used for our Windows Binaries and our WIndows CI builds. So we try to maintain this environment to be ready to build.
There is a wiki article for building with this https://www.widelands.org/wiki/BuildingWidelandsUnderWindowsNew/.
If you have problems with it you can look in the appveyor.yml file in the sources to see which commands are used to build. And the options for the makefile are the same as for linux.
Personally this works fine for me since some years.

Edit: And yes devs are very welcome. A second Visual Studio expert who could manage to build with this environment would be welcome as well.

Edited: 2021-04-24, 21:33

Top Quote
Atanase
Avatar
Joined: 2021-04-15, 13:33
Posts: 126
Ranking
At home in WL-forums
Location: Béarn (France)
Posted at: 2021-04-25, 00:58

Sorry, just I didn't understand.
It is YOUR choice and I respect it. I though, but wrongly, that you tried to compile on Linux and I didn't see why you wanted to use VS since it's easier with 'compile.sh'. I understand that you enjoy using VS, you would be surprised to see what entertains me on the computer.
I was a real geek, one of those who looked at the meteo site to find out what the weather is like instead of going to the garden. face-smile.png face-smile.png


La connaissance ne vaut que si elle est partagée par le plus grand nombre.
---------------------------------------
Knowledge is only valuable if it is shared by the greatest number.

Top Quote