Loobinex / keeperfx-unofficial

KeeperFX - Unofficial release
60 stars 7 forks source link

Can now be compiled with MSYS2 mingw32 #168

Closed Real-Gecko closed 4 years ago

Real-Gecko commented 4 years ago

However it'll require libwinpthread-1.dll from MSYS2 in game folder.

Loobinex commented 4 years ago

@Real-Gecko Yes, this should be able to be build without this change, and more importantly, without requiring an additional dll. What's the error you used to get before you made the change from this pull?

I use WSL to build by the way:

Open Powershell as Administrator and type: "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux". Restart.
Go here: https://www.microsoft.com/store/apps/9N9TNGVNDL3Q to install Ubuntu 18.04 from windows store.

Type: "sudo apt update && sudo apt upgrade" and confirm

sudo apt install make
sudo apt install unzip
sudo apt install gcc
sudo apt install g++
sudo apt-get install gcc-mingw-w64-i686
sudo apt-get install g++-mingw-w64-i686
AdamPlenty commented 4 years ago

I can build in MSYS2, but the exe file does require the additional DLL file.

Real-Gecko commented 4 years ago

I've been compiling this with MSYS2 minigw32 for ages...

Which version of MSYS2 do you use? I've installed version 20200720 and used pacman to install mingw32. It turns out that MSYS2 tar does not support --no-anchored flag, which is odd, that's why I changed libexterns.mk. During linking stage I had an error multiple definition of atktyp first defined here in various files that included creature_states_combt.h that's why I removed it from creature_states_combt.h, this variable can be completely removed anyway. And about libwinpthread-1.dll I don't know why it's became required, maybe some changes in newer versions of mingw32.

Real-Gecko commented 4 years ago

OK, I've figured it out. By default MSYS2 installs bsdtar as a part of base group, and it does not support --no-anchored flag. But I can install tar package that'll override bsdtar and does support this flag, so changes to libexterns.mk are not needed. However it leaves multiple definition of atktyp first defined here error unresolved.

Loobinex commented 4 years ago

ok, update this pull to remove the changes to the makefile and I'd be happy to merge.

Real-Gecko commented 4 years ago

Did that!