An obsolete environment for building gbsim with Windows - use instead
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

gbsim Windows port

This is DEPRECATED - use the original repository instead.


  1. Install msys2 (I used 64 bit)
  2. Run update-core and pacman -Suu, as described in the instructions
  3. Install these packages (pacman -S ...):
  • mingw-w64-i686-toolchain
  • git
  • make
  1. Update the path for mingw: export PATH=$PATH:/mingw32/bin

  2. make

  3. The binary is in gbsim/gbsim/obj-i686-w64-mingw32/main.elf - it's actually an executable, so rename it to .exe.

     $ file gbsim/gbsim/obj-i686-w64-mingw32/main.elf
     gbsim/gbsim/obj-i686-w64-mingw32/main.elf: PE32 executable (console) Intel 80386, for MS Windows

Before distributing the file, run ldd on it to confirm that it depends only on Windows files:

$ ldd gbsim/gbsim/obj-i686-w64-mingw32/main.elf
    ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x771b0000)
    KERNEL32.DLL => /c/WINDOWS/SYSTEM32/KERNEL32.DLL (0x76310000)
    KERNELBASE.dll => /c/WINDOWS/SYSTEM32/KERNELBASE.dll (0x76190000)
    GDI32.dll => /c/WINDOWS/SYSTEM32/GDI32.dll (0x74290000)
    USER32.dll => /c/WINDOWS/SYSTEM32/USER32.dll (0x76f00000)

The executable size can be reduced with strip and UPX.


simavr does some magic with avrlibc - it uses its headers to get the definitions for each chip. We only care about one, so it would be easier to copy this manually, then avrlibc wouldn't be necessary.

msys2 comes with SDL and libelf, so we don't need those either. That means with the avrlibc dependency removed, the upstream code could be built without this special Windows package.