Mingw GCC on an Windows XP machine (32bit).
This issue is now solved, it was a conflict between several versions of zlib / png (Why does Mingw use two locations mingw/include and mingw/msys/1.0/include...)
I also had trouble with leftovers in the 3rdparty directory that stay there despite make clean and git reset --hard.
For memory, I have to build with make API=sdl2 SDL2CONFIG=sdl2-config
because otherwise the makefile autodetects SDL2CONFIG as 'empty string', resulting in error messages : make: --cflags: Command not found
I have to fix sdl2-config itself because the official 2.0.12 release has a prefix with a nonsense directory /opt/local/i686-w64-mingw32 (???) An empty prefix makes it produce the correct CFLAGS
The other changes I have to do in order to compile:
Manually download recoil-5.0.0.tar.gz and 6502-v0.1.tar.xz into 3rdparty/archives. The current hosts are serving files through a HTTPS protocol that is not supported by windows XP.
Makefile:
-$(OBJDIR)/recoil.o: CFLAGS += -Wno-declaration-after-statement -Wno-unused-parameter
+$(OBJDIR)/recoil.o: CFLAGS += -Wno-declaration-after-statement -Wno-unused-parameter -std=gnu99
Because GCC 4.6.2 by default chokes on all the for (int i=...;;)
Many files :
Before including <windows.h>, _WIN32_WINNT and/or WINVER has to be set to at least 0x0500 (meaning Windows 2000 and later, such as Windows XP) because Grafx2 references at least the following that need it (there may be more) :
- CF_DIBV5 (a bitmap header ID)
- VK_OEM_COMMA (a key ID)
- AddFontResourceExA()
- FR_PRIVATE
- NTM_TT_OPENTYPE
It's a bit tricky because for example shade.c includes keycodes.h and screen.h, which both #include <windows.h> - and the first one that gets included wins.
The cleanest option would have to be a single place that #include <windows.h>, and it is preceded by
#ifndef WINVER
#define WINVER 0x0500
#endif
With this, the api=SDL2 version compiles and runs
Yves