Trouble Compiling Code

Talk about anything concerning the source code.
Post Reply
Justitia
Posts: 5
Joined: Fri Dec 18, 2020 2:31 am

Trouble Compiling Code

Post by Justitia »

Hello,

I am trying to compile the source code for GIMX, following these instructions: https://gimx.fr/wiki/index.php?title=De ... on_Windows

Everything goes fine until the very last step, when I actually need to compile the code. Following the guide, I run the following commands in mingw64.exe:
cd GIMX-build/windows
./build.sh


Here is the full output from the console:
https://pastebin.com/CZirnEFp

I'm pretty new to all of this, but I'm pretty sure the bit below is the relevant part. It seems like the compiler is failing due to thinking there is some error in the sources code. I've tried to dig through it and figure out what the problem may be, but unfortunately I don't quite know enough about what I'm looking at. Any chance anyone can help identify the problem, or at least point me in the right direction to start hunting it down on my own?

Thanks!

src/windows/events.c:179:1: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'gtime' {aka 'long long unsigned int'} [-Werror=format=]
179 | GPERF_LOG(ev_sync_process);
| ^ ~~~~~~~~~~~~~~~~~
../gimxcommon/include/gperf.h:13:23: note: in definition of macro 'GPERF_STR'
13 | #define GPERF_STR(s) #s
| ^
../gimxcommon/include/gperf.h:87:20: note: in expansion of macro 'GPERF_XSTR'
87 | printf(GPERF_XSTR(NAME)": count = "GTIME_FS", average = "GTIME_FS", worst = "GTIME_FS"\n", gperf_##NAME.count, gperf_##NAME.sum / gperf_##NAME.count, gperf_##NAME.worst); \
| ^~~~~~~~~~
src/windows/events.c:179:5: note: in expansion of macro 'GPERF_LOG'
179 | GPERF_LOG(ev_sync_process);
| ^~~~~~~~~
cc1.exe: all warnings being treated as errors
make[2]: *** [<builtin>: src/windows/events.o] Error 1
make[2]: Leaving directory '/home/Andre/GIMX-build/windows/GIMX/shared/gimxinput'
make[1]: *** [Makefile:35: build-gimxinput] Error 2
make[1]: Leaving directory '/home/Andre/GIMX-build/windows/GIMX/shared'
make: *** [Makefile:15: build-shared] Error 2
make: Leaving directory '/home/Andre/GIMX-build/windows/GIMX'
User avatar
kaiba_seto2004
Posts: 535
Joined: Sat Jul 15, 2017 9:15 am

Re: Trouble Compiling Code

Post by kaiba_seto2004 »

I've never compiled gimx success on Win but Linux. I think these scripts need to be rewrited up to new version :)
PS4 enthusiast.
Justitia
Posts: 5
Joined: Fri Dec 18, 2020 2:31 am

Re: Trouble Compiling Code

Post by Justitia »

Thanks for the reply!

I may go ahead and install linux on a spare computer, then, and see if I have any better luck. Is it possible to create a windows installer from linux? I'm assuming not, in which case someone must be compiling the source code on windows, otherwise there wouldn't be a windows installer available to download, right?

As a side note, I've also tried installing the eclipse IDE, and compiling the source code from there. I assumed that wouldn't make a difference, and it appears to be the case, as I get essentially the same errors showing up in eclipse's console when I try to build the project. I tried importing older versions of the source code into eclipse, but those wouldn't build either.

Thanks again for the help!
Justitia
Posts: 5
Joined: Fri Dec 18, 2020 2:31 am

Re: Trouble Compiling Code

Post by Justitia »

Update: I installed ubuntu alongside windows 10 on my computer, and the guide for compiling the code on linux works fine.
User avatar
Matlo
Posts: 5767
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Trouble Compiling Code

Post by Matlo »

Moved to development section.

The compilation issues are probably due to using a newer compiler. GIMX 8.0 was built using GCC 9.2.
GIMX creator Donate Shop
User avatar
Matlo
Posts: 5767
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Trouble Compiling Code

Post by Matlo »

I just fixed the compilation issue. Running build.sh should work fine.
GIMX creator Donate Shop
r!dEr
Posts: 2
Joined: Mon Jun 06, 2022 8:25 am

Re: Trouble Compiling Code

Post by r!dEr »

Again there seems to be some problems with compilation for Windows (Linux works ok).

Code: Select all

make -C gimxcontroller UHID=
make[2]: Entering directory '/home/r!dEr/GIMX-build/windows/GIMX/shared/gimxcontroller'
cc -fPIC -Iinclude -Wall -Wextra -Werror -O3 -D__USE_MINGW_ANSI_STDIO=0 -I../ -DGLOG_NAME=gimxcontroller  -c -o src/controller.o src/controller.c
src/controller.c: In function 'controller_get_axis_index':
src/controller.c:361:10: error: the comparison will always evaluate as 'true' for the address of 'name' will never be NULL [-Werror=address]
  361 |       if(controllers[C_TYPE_SIXAXIS]->axes[i].name)
      |          ^~~~~~~~~~~
In file included from src/controller.c:6:
src/../include/controller.h:46:14: note: 'name' declared here
   46 |   const char name[AXIS_NAME_MAX_SIZE];
      |              ^~~~
cc1.exe: all warnings being treated as errors
make[2]: *** [<builtin>: src/controller.o] Error 1
make[2]: Leaving directory '/home/r!dEr/GIMX-build/windows/GIMX/shared/gimxcontroller'
make[1]: *** [Makefile:35: build-gimxcontroller] Error 2
make[1]: Leaving directory '/home/r!dEr/GIMX-build/windows/GIMX/shared'
make: *** [Makefile:15: build-shared] Error 2
But it seems more like a "compiler version issue" than problems in the code. :(
I tried to build BRANCH master and v8.0 but outcome is similar.

Is there any recommendation how to setup minigw64 environment to be able to compile GIMX for Windows?

P.S. it need version 5 of INNO and it has to be installed into c:\Program Files (not x86!).

EDIT:
When compiling tag v8.0 with latest version of minigw64 (GCC 12.1.0) it is necessary to apply following changes:
- Install INNO v5 in c:\Program Files (not Program Files (x86) !!)
- Remove treating of Warnings as errors (Go through various Makedef files and remove -Werror switch from CFLAGS)
- define WINVER 0x0602 or greater (W10 is 0x0A00) into GIMX/core/gimx.c before inclusion of windows.h otherwise POINTER_TYPE_INFO and some other types are not defined

While debugging split repository cloning and build part. If you notice some files are throwing errors try to find local Makedefs and remove -Werror switch from inside. If you would like to play with specific version change BRANCH to v8.0 for example.

Happy modding :)
Post Reply