-
Notifications
You must be signed in to change notification settings - Fork 0
Compiling on Windows
Compilation on Windows is slightly more complex that those of MacOS or Linux, so bear with me.
We'll use MSYS2 for most steps except when building Gosu. In MSYS2, install the following packages:
ruby
git
make
cmake
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-dlfcn
mingw-w64-ucrt-x86_64-binutils # Optional, if you want to strip the binary
Get the source code from the releases page then extract it on some place. Then build the Visual C++ project under windows/Gosu.sln
, you can use either msbuild
or vcexpress
from the command line to build it:
msbuild Gosu.sln /p:Configuration=Release
or
vcexpress Gosu.sln /p:Configuration=Release
Note the generated Gosu.lib
and gosu-ffi.lib
, we'll need them later. Oh and rename Gosu.lib
to gosu.lib
.
Get the source code from releases page and extract it, on the vendor
directory, create a directory named gosu
, then move the ffi
directory of Gosu there, and make another directory named lib64
, place the .lib
files there. Your final directory structure should look like this:
.
├── assets
├── include
├── scripts
│ └── mruby
├── src
└── vendor
├── gosu
│ ├── ffi
│ │ └── Various headers needed for compilation...
│ └── lib64
│ ├── libgosu-ffi.lib
│ └── libgosu.lib
├── mruby
├── physfs
└── whereami
Then, on a MSYS2 console, run the following:
mkdir build
cd build
cmake ..
make
And that's it!
You'll need some .dll
s for it work correctly, here's the list:
-
gosu-ffi.dll
: built when we built Gosu, on thelib64/
directory. -
SDL2.dll
: on thelib64/
directory. -
libstdc++-6.dll
: onmsy64/ucrt64/
. -
libgcc_s_seh-1.dll
: onmsy64/ucrt64/
. -
libwinpthread-1.dll
: onmsy64/ucrt64/
.