Compiling with MinGW on Win 8.1?

Hey there,

After quite a while away from modding ioq3 I’ve been trying to set up mingw etc on my new Windows 8.1 PC. Previously I had been compiling on XP without any issue, but now on the new computer I’m getting an error during compiling that I haven’t had before… even with exactly the same mingw files and with builds straight from the ioq3 repository. See below:

make[1]: Entering directory `/c/ioq3-master'

Building in build/release-mingw32-x86:
  PLATFORM: mingw32
  ARCH: x86
  VERSION: 1.36
  COMPILE_PLATFORM: mingw32
  COMPILE_ARCH: x86
  CC: cc
  WINDRES: windres

  CFLAGS:
    -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes -DUSE_ICON
    -DWINVER=0x501 -m32 -DNO_GZIP -Icode/zlib -DUSE_INTERNAL_JPEG
    -Icode/jpeg-8c -DUSE_LOCAL_HEADERS -DPRODUCT_VERSION="1.36" -Wformat=2
    -Wno-format-zero-length -Wformat-security -Wno-format-nonliteral
    -Wstrict-aliasing=2 -Wmissing-format-attribute -Wdisabled-optimization
    -Werror-implicit-function-declaration -MMD -DNDEBUG -O3 -march=i586
    -ffast-math

  CLIENT_CFLAGS:
    -DCURL_STATICLIB -Icode/SDL2/include -DUSE_OPENAL -DUSE_OPENAL_DLOPEN
    -DUSE_CURL -DUSE_CODEC_OPUS -DOPUS_BUILD -DHAVE_LRINTF -DFLOATING_POINT
    -DUSE_ALLOCA -Icode/opus-1.1/include -Icode/opus-1.1/celt
    -Icode/opus-1.1/silk -Icode/opus-1.1/silk/float -Icode/opusfile-0.5/include
    -Icode/libogg-1.3.1/include -DUSE_RENDERER_DLOPEN -DUSE_MUMBLE -DUSE_VOIP
    -DFLOATING_POINT -DUSE_ALLOCA -Icode/libspeex/include

  SERVER_CFLAGS:
    -DUSE_VOIP

  LDFLAGS:


  LIBS:
    -lws2_32 -lwinmm -lpsapi

  CLIENT_LIBS:
    -lgdi32 -lole32 code/libs/win32/libcurl.a -lmingw32
    code/libs/win32/libSDL2main.a code/libs/win32/libSDL2.dll.a

  Output:
    ioq3ded.x86.exe
    ioquake3.x86.exe
    renderer_opengl1_x86.dll
    renderer_opengl2_x86.dll
    baseq3/cgamex86.dll
    baseq3/qagamex86.dll
    baseq3/uix86.dll
    missionpack/cgamex86.dll
    missionpack/qagamex86.dll
    missionpack/uix86.dll
    baseq3/vm/cgame.qvm
    baseq3/vm/qagame.qvm
    baseq3/vm/ui.qvm
    missionpack/vm/cgame.qvm
    missionpack/vm/qagame.qvm
    missionpack/vm/ui.qvm
    SDL2.dll

make[2]: Entering directory `/c/ioq3-master'
make[2]: `build/release-mingw32-x86/ioq3ded.x86.exe' is up to date.
make[2]: `build/release-mingw32-x86/ioquake3.x86.exe' is up to date.
make[2]: `build/release-mingw32-x86/renderer_opengl1_x86.dll' is up to date.
make[2]: `build/release-mingw32-x86/renderer_opengl2_x86.dll' is up to date.
make[2]: `build/release-mingw32-x86/baseq3/cgamex86.dll' is up to date.
make[2]: `build/release-mingw32-x86/baseq3/qagamex86.dll' is up to date.
UI_CC code/q3_ui/ui_main.c
<command-line>:0:4: error: expected identifier or '(' before numeric constant
code/q3_ui/../qcommon/q_shared.h:190:15: note: in expansion of macro 'ui'
  unsigned int ui;
               ^
In file included from code/q3_ui/ui_local.h:26:0,
                 from code/q3_ui/ui_main.c:32:
code/q3_ui/../qcommon/q_shared.h:191:1: warning: no semicolon at end of struct o
r union [enabled by default]
 } floatint_t;
 ^
make[2]: *** [build/release-mingw32-x86/baseq3/ui/ui_main.o] Error 1
make[2]: Leaving directory `/c/ioq3-master'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/c/ioq3-master'
make: *** [release] Error 2

So it seems to be an issue as soon as it gets to doing q3_ui. I have no idea what is causing this but it’s the same error regardless of whether I’m trying to compile ioq3 or heavily modified ioq3 forks. Is this a known issue with Win 8.1 or am I doing something wrong here? Thanks.

themuffinator, the other day somebody on #ioquake3 on freenode (they were far more skilled than I) said how ioq3 was not compiling on a new version of gcc. Perhaps try downgrading until there is a fix? Then you can see if it compiles.

My version of mingw64_x86_64-gcc-core is 4.9.2. So uninstall the current one and install that. See if it compiles.

This is an issue with mingw32. ioq3 report. mingw32 report.

The recommended solution is using mingw-w64.

I couldn’t quite get mingw-w64 working… or at least not the gcc part of it. I’m pretty clueless with all of this though. Nonetheless I changed the name of the ui member to fui and it compiles quite fine. Just a pity it breaks compatibility with ioq3/q3 but until I figure out mingw-w64 it’ll have to do. Thanks for the help!

Hey I got the same error ! But I’m on win7 starter on a netbook. The netbook’s CPU isn’t 64 bits. Is using mingw-w64 even possible ?

It’s not a very clean fix, I don’t want to use it >o< Any other (simple) solution ?

FIXED !

Sometimes, searching through bug submissions is something intimidating, but tonight the exploration of dark runes payed off :smile:

So, @themuffinator, Here’s a copy-paste from the first link provided by our master TimeDoctor :

To go faster just copy this to your q_shared.h, line 187 !

And yeah, your original solution of renaming the name of the variable also works, but I feel this is cleaner :smile:

Thanks for your patience !

(Maybe this issue could be added on the wiki page "building with minGW and Msys ?)