Electronicks / JoyShockMapper

A tool for PC gamers to play games with DualShock 4s, JoyCons, and Pro Controllers. Gyro aiming, flick stick.
Other
372 stars 20 forks source link

Doesn't compile on Arch #71

Closed arkdae closed 1 year ago

arkdae commented 2 years ago

I get the following compiler error:

Consolidate compiler generated dependencies of target SDL2
[  0%] Building C object _deps/sdl2-build/CMakeFiles/SDL2.dir/src/audio/pipewire/SDL_pipewire.c.o
In file included from /usr/include/pipewire-0.3/pipewire/properties.h:35,
                 from /usr/include/pipewire-0.3/pipewire/core.h:87,
                 from /usr/include/pipewire-0.3/pipewire/context.h:67,
                 from /usr/include/pipewire-0.3/pipewire/protocol.h:46,
                 from /usr/include/pipewire-0.3/pipewire/proxy.h:108,
                 from /usr/include/pipewire-0.3/pipewire/client.h:35,
                 from /usr/include/pipewire-0.3/pipewire/pipewire.h:35,
                 from /home/jlm/.cache/pacaur/joyshockmapper-git/joyshockmapper-git/src/JoyShockMapper/build/_deps/sdl2-src/src/audio/pipewire/SDL_pipewire.h:28,
                 from /home/jlm/.cache/pacaur/joyshockmapper-git/joyshockmapper-git/src/JoyShockMapper/build/_deps/sdl2-src/src/audio/pipewire/SDL_pipewire.c:29:
/usr/include/spa-0.2/spa/utils/string.h: In function ‘spa_strtof’:
/usr/include/spa-0.2/spa/utils/string.h:282:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  282 |         locale_t prev = uselocale(locale);
      |         ^~~~~~~~
/usr/include/spa-0.2/spa/utils/string.h: In function ‘spa_strtod’:
/usr/include/spa-0.2/spa/utils/string.h:325:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  325 |         locale_t prev = uselocale(locale);
      |         ^~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [_deps/sdl2-build/CMakeFiles/SDL2.dir/build.make:1856: _deps/sdl2-build/CMakeFiles/SDL2.dir/src/audio/pipewire/SDL_pipewire.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:226: _deps/sdl2-build/CMakeFiles/SDL2.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
arkdae commented 2 years ago

Looks like this is a problem in SDL. I'll follow up there.

Found it: https://github.com/libsdl-org/SDL/issues/5535

Ultimately it is a problem in PipeWire, which is fixed. I simply applied the small change to my string.h include file and it compiles. https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2303

Electronicks commented 1 year ago

Linux is not officially supported. You may be able to find help on the community discord Gyro Gaming. If you do find a fix, feel free to suggest a pull request and I will merge it.