Bug#952049: pekka-kana-2: FTBFS: SDL_image.h:100:24: error: missing binary operator before token "("
Simon McVittie
smcv at debian.org
Sun Feb 23 20:14:36 GMT 2020
Control: tags -1 + patch
On Sun, 23 Feb 2020 at 19:06:42 +0000, Simon McVittie wrote:
> - Some weirdness in src/draw.cpp where it includes <SDL2/SDL_image.h>
> but doesn't link to -lSDL2_image, which I currently don't fully understand
> (perhaps src/draw.cpp really only needs the base SDL2 library, and not
> SDL2_image?)
This seems to be related to the build system not passing the $(CXXFLAGS)
to all $(CXX) invocations. See attached patch, also available at
<https://salsa.debian.org/games-team/pekka-kana-2/merge_requests/1>.
I don't really understand why libsdl2 merge request 3 avoids this, but
for some reason it does.
I've also attached/included a patch to make the build show what it's
doing, which is called for by Policy ยง4.9; I found that change very
useful to debug this. The V=1 convention is fairly common; the
implementation using $(Q) is adapted from ioquake3.
> - Fix pekka-kana-2 to stop making these assumptions, and instead use SDL
> with the recommended patterns:
> - PKG_CONFIG ?= pkg-config
> (so that cross-compilation uses the correct cross-pkg-config)
> - add $(${PKG_CONFIG} --cflags sdl2) to all C/C++ compiler command-lines
> - add $(${PKG_CONFIG} --libs sdl2) to linker command-line
> - add $(${PKG_CONFIG} --cflags SDL2_mixer) to all C/C++ compiler
> command-lines
> - add $(${PKG_CONFIG} --libs SDL2_mixer) to linker command-line
> - include SDL.h (where required) with #include <SDL.h>
> - include SDL_mixer.h (where required) with #include <SDL_mixer.h>
> - if SDL2_image is required, do the same as for SDL2_mixer
> - if SDL2_image is not required, use #include <SDL.h> instead
My merge request does not implement all this, only the bare minimum
to get this package compiling again.
smcv
More information about the Pkg-games-devel
mailing list