# Compiling with MinGW on Win 8.1?

**URL:** <https://discourse.ioquake.org/t/compiling-with-mingw-on-win-8-1/531>\
**Category:** support\
**Created:** [August 5, 2015, 2:15pm UTC](https://discourse.ioquake.org/t/compiling-with-mingw-on-win-8-1/531 "2015-08-05T14:15:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![themuffinator](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.ioquake.org/themuffinator/32/497_2.png) [@themuffinator](https://discourse.ioquake.org/u/themuffinator)\
**Post date:** [August 5, 2015, 2:15pm UTC](https://discourse.ioquake.org/t/compiling-with-mingw-on-win-8-1/531/1 "2015-08-05T14:15:00Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![thefounder](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@thefounder](https://discourse.ioquake.org/u/thefounder)\
**Post date:** [August 5, 2015, 5:10pm UTC](https://discourse.ioquake.org/t/compiling-with-mingw-on-win-8-1/531/2 "2015-08-05T17:10:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zturtleman](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.ioquake.org/zturtleman/32/718_2.png) [@zturtleman](https://discourse.ioquake.org/u/zturtleman)\
**Post date:** [August 5, 2015, 9:43pm UTC](https://discourse.ioquake.org/t/compiling-with-mingw-on-win-8-1/531/3 "2015-08-05T21:43:32Z")

</div>

This is an issue with mingw32. [ioq3 report](https://bugzilla.icculus.org/show_bug.cgi?id=6087). [mingw32 report](https://sourceforge.net/p/mingw/bugs/2183/).

The recommended solution is using mingw-w64.

---

<div class="post-metadata">

**Author:** ![themuffinator](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.ioquake.org/themuffinator/32/497_2.png) [@themuffinator](https://discourse.ioquake.org/u/themuffinator)\
**Post date:** [August 6, 2015, 10:36pm UTC](https://discourse.ioquake.org/t/compiling-with-mingw-on-win-8-1/531/4 "2015-08-06T22:36:49Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![dmeat](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@dmeat](https://discourse.ioquake.org/u/dmeat)\
**Post date:** [August 28, 2015, 1:33pm UTC](https://discourse.ioquake.org/t/compiling-with-mingw-on-win-8-1/531/5 "2015-08-28T13:33:05Z")

</div>

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 ?

> [@themuffinator](#):
>
> Nonetheless I changed the name of the ui member to fui and it compiles quite fine.

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

---

<div class="post-metadata">

**Author:** ![dmeat](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@dmeat](https://discourse.ioquake.org/u/dmeat)\
**Post date:** [August 29, 2015, 1:10pm UTC](https://discourse.ioquake.org/t/compiling-with-mingw-on-win-8-1/531/6 "2015-08-29T13:10:10Z")

</div>

FIXED !

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

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

> [@](#):
>
> Adding this in q\_shared.h before the union declaration resolves the issue:
> 
> #ifdef ui  
> #undef ui  
> #endif

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 😄

Thanks for your patience !

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