Compile fails
It must be OS updates on my end (arch-linux), but current master fails to compile.
$ meson setup build
:
The Meson build system
Version: 1.4.0
Source dir: /home/aaruni/Programs/git/GitLab/BuiltFromSource/TenhauserGate
Build dir: /home/aaruni/Programs/git/GitLab/BuiltFromSource/TenhauserGate/build
Build type: native build
Project name: homeworld
Project version: 1.2.0
C compiler for the host machine: cc (gcc 14.1.1 "cc (GCC) 14.1.1 20240507")
C linker for the host machine: cc ld.bfd 2.42.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
meson.build:7: WARNING: Building with memory sanitizers on. If linking fails, try disabling them with `meson configure -Db_sanitize=none`.
Found pkg-config: YES (/usr/bin/pkg-config) 2.1.1
Run-time dependency sdl2 found: YES 2.30.3
Run-time dependency gl found: YES 1.2
Library m found: YES
Run-time dependency x11 found: YES 1.8.9
meson.build:55: WARNING: Building with video cutscenes support. This requires a handful of extra dependencies (usually provided by FFMPEG). Disable with `meson configure -Dmovies=false`
Run-time dependency libavutil found: YES 58.29.100
Run-time dependency libswscale found: YES 7.5.100
Run-time dependency libavcodec found: YES 60.31.102
Run-time dependency libavformat found: YES 60.16.100
Program flex found: YES (/usr/bin/flex)
Program bison found: YES (/usr/bin/bison)
Build targets in project: 34
Found ninja-1.12.1 at /usr/bin/ninja
$ meson compile
:
FAILED: src/SDL/libhw_sdl.a.p/avi.c.o
cc -Isrc/SDL/libhw_sdl.a.p -Isrc/SDL -I../src/SDL -Isrc/Game -I../src/Game -Isrc/Ships -I../src/Ships -Isrc/ThirdParty/CRC -I../src/ThirdParty/CRC -Isrc/ThirdParty/stb -I../src/ThirdParty/stb -I/usr/include/SDL2 -fdiagnostics-color=always -fsanitize=address,undefined -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c17 -O0 -g -fPIC -DHW_GAME_HOMEWORLD -DHAVE_CONFIG_H -D_REENTRANT -w -D_X86_64 -D_X86_64_FIX_ME -DGENERIC_ETGCALLFUNCTION -D_LINUX_FIX_ME -D_GNU_SOURCE -DHW_BUILD_FOR_DEBUGGING -DHW_ENABLE_MOVIES -MD -MQ src/SDL/libhw_sdl.a.p/avi.c.o -MF src/SDL/libhw_sdl.a.p/avi.c.o.d -o src/SDL/libhw_sdl.a.p/avi.c.o -c ../src/SDL/avi.c
../src/SDL/avi.c: In function ‘aviPlayLoop’:
../src/SDL/avi.c:321:14: error: implicit declaration of function ‘av_image_get_buffer_size’; did you mean ‘av_samples_get_buffer_size’? [-Wimplicit-function-declaration]
321 | numBytes=av_image_get_buffer_size(AV_PIX_FMT_RGB24, pCodecCtx->width, pCodecCtx->height, ALIGN);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| av_samples_get_buffer_size
../src/SDL/avi.c:328:5: error: implicit declaration of function ‘av_image_fill_arrays’; did you mean ‘av_samples_fill_arrays’? [-Wimplicit-function-declaration]
328 | av_image_fill_arrays(pPictureRGB->data, pPictureRGB->linesize, buffer, AV_PIX_FMT_RGB24, pCodecCtx->width, pCodecCtx->height, ALIGN);
| ^~~~~~~~~~~~~~~~~~~~
| av_samples_fill_arrays
../src/SDL/avi.c:356:46: error: passing argument 2 of ‘sws_scale’ from incompatible pointer type [-Wincompatible-pointer-types]
356 | sws_scale(img_convert_ctx, pFrame->data,pFrame->linesize, 0, pCodecCtx->height, pPictureRGB->data,pPictureRGB->linesize);
| ~~~~~~^~~~~~
| |
| uint8_t ** {aka unsigned char **}
In file included from ../src/SDL/avi.c:41:
/usr/include/libswscale/swscale.h:224:58: note: expected ‘const uint8_t * const*’ {aka ‘const unsigned char * const*’} but argument is of type ‘uint8_t **’ {aka ‘unsigned char **’}
224 | int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
../src/SDL/avi.c: In function ‘aviStart’:
../src/SDL/avi.c:428:79: error: passing argument 5 of ‘av_find_best_stream’ from incompatible pointer type [-Wincompatible-pointer-types]
428 | videoStream = av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_VIDEO, -1, -1, &pCodec, 0);
| ^~~~~~~
| |
| AVCodec **
In file included from ../src/SDL/avi.c:39:
/usr/include/libavformat/avformat.h:2113:48: note: expected ‘const struct AVCodec **’ but argument is of type ‘AVCodec **’
2113 | const struct AVCodec **decoder_ret,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
If I "fix" that by adding libavutil/imagutils.h to imports, I get
$ meson compile
:
FAILED: homeworld.p/src_Game_Attack.c.o
cc -Ihomeworld.p -I. -I.. -Isrc/Game -I../src/Game -Isrc/SDL -I../src/SDL -Isrc/Missions/Tutorials -I../src/Missions/Tutorials -Isrc/Missions/SinglePlayer -I../src/Missions/SinglePlayer -Isrc/Ships -I../src/Ships -Isrc/ThirdParty/CRC -I../src/ThirdParty/CRC -Isrc/ThirdParty/LZSS -I../src/ThirdParty/LZSS -Isrc/ThirdParty/Titan -I../src/ThirdParty/Titan -Isrc/ThirdParty/stb -I../src/ThirdParty/stb -I/usr/include/SDL2 -fdiagnostics-color=always -fsanitize=address,undefined -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c17 -O0 -g -DHW_GAME_HOMEWORLD -DHAVE_CONFIG_H -D_REENTRANT -w -D_X86_64 -D_X86_64_FIX_ME -DGENERIC_ETGCALLFUNCTION -D_LINUX_FIX_ME -D_GNU_SOURCE -DHW_BUILD_FOR_DEBUGGING -DHW_ENABLE_MOVIES -MD -MQ homeworld.p/src_Game_Attack.c.o -MF homeworld.p/src_Game_Attack.c.o.d -o homeworld.p/src_Game_Attack.c.o -c ../src/Game/Attack.c
../src/Game/Attack.c:31:45: error: initialization of ‘long unsigned int’ from ‘real32 *’ {aka ‘float *’} makes integer from pointer without a cast [-Wint-conversion]
31 | { "repositionTime", scriptSetReal32CB, &(sampleSideStepParameters.repositionTime), &sampleSideStepParameters },
| ^
../src/Game/Attack.c:31:45: note: (near initialization for ‘AttackSideStepParametersScriptTable[0].offset1’)
../src/Game/Attack.c:31:90: error: initialization of ‘long unsigned int’ from ‘AttackSideStepParameters *’ makes integer from pointer without a cast [-Wint-conversion]
31 | { "repositionTime", scriptSetReal32CB, &(sampleSideStepParameters.repositionTime), &sampleSideStepParameters },
| ^
../src/Game/Attack.c:31:90: note: (near initialization for ‘AttackSideStepParametersScriptTable[0].offset2’)
../src/Game/Attack.c:32:45: error: initialization of ‘long unsigned int’ from ‘real32 *’ {aka ‘float *’} makes integer from pointer without a cast [-Wint-conversion]
32 | { "circleRange", scriptSetReal32CB, &(sampleSideStepParameters.circleRange), &(sampleSideStepParameters) },
| ^
../src/Game/Attack.c:32:45: note: (near initialization for ‘AttackSideStepParametersScriptTable[1].offset1’)
../src/Game/Attack.c:32:87: error: initialization of ‘long unsigned int’ from ‘AttackSideStepParameters *’ makes integer from pointer without a cast [-Wint-conversion]
32 | { "circleRange", scriptSetReal32CB, &(sampleSideStepParameters.circleRange), &(sampleSideStepParameters) },
| ^
../src/Game/Attack.c:32:87: note: (near initialization for ‘AttackSideStepParametersScriptTable[1].offset2’)
../src/Game/Attack.c:33:45: error: initialization of ‘long unsigned int’ from ‘bool32 *’ {aka ‘unsigned int *’} makes integer from pointer without a cast [-Wint-conversion]
33 | { "fullMovementFreedom", scriptSetBool, &(sampleSideStepParameters.fullMovementFreedom), &(sampleSideStepParameters) },
| ^
../src/Game/Attack.c:33:45: note: (near initialization for ‘AttackSideStepParametersScriptTable[2].offset1’)
../src/Game/Attack.c:33:95: error: initialization of ‘long unsigned int’ from ‘AttackSideStepParameters *’ makes integer from pointer without a cast [-Wint-conversion]
33 | { "fullMovementFreedom", scriptSetBool, &(sampleSideStepParameters.fullMovementFreedom), &(sampleSideStepParameters) },
| ^
../src/Game/Attack.c:33:95: note: (near initialization for ‘AttackSideStepParametersScriptTable[2].offset2’)
[8/184] Compiling C object src/SDL/libhw_sdl.a.p/avi.c.o
FAILED: src/SDL/libhw_sdl.a.p/avi.c.o
cc -Isrc/SDL/libhw_sdl.a.p -Isrc/SDL -I../src/SDL -Isrc/Game -I../src/Game -Isrc/Ships -I../src/Ships -Isrc/ThirdParty/CRC -I../src/ThirdParty/CRC -Isrc/ThirdParty/stb -I../src/ThirdParty/stb -I/usr/include/SDL2 -fdiagnostics-color=always -fsanitize=address,undefined -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c17 -O0 -g -fPIC -DHW_GAME_HOMEWORLD -DHAVE_CONFIG_H -D_REENTRANT -w -D_X86_64 -D_X86_64_FIX_ME -DGENERIC_ETGCALLFUNCTION -D_LINUX_FIX_ME -D_GNU_SOURCE -DHW_BUILD_FOR_DEBUGGING -DHW_ENABLE_MOVIES -MD -MQ src/SDL/libhw_sdl.a.p/avi.c.o -MF src/SDL/libhw_sdl.a.p/avi.c.o.d -o src/SDL/libhw_sdl.a.p/avi.c.o -c ../src/SDL/avi.c
../src/SDL/avi.c: In function ‘aviPlayLoop’:
../src/SDL/avi.c:357:46: error: passing argument 2 of ‘sws_scale’ from incompatible pointer type [-Wincompatible-pointer-types]
357 | sws_scale(img_convert_ctx, pFrame->data,pFrame->linesize, 0, pCodecCtx->height, pPictureRGB->data,pPictureRGB->linesize);
| ~~~~~~^~~~~~
| |
| uint8_t ** {aka unsigned char **}
In file included from ../src/SDL/avi.c:41:
/usr/include/libswscale/swscale.h:224:58: note: expected ‘const uint8_t * const*’ {aka ‘const unsigned char * const*’} but argument is of type ‘uint8_t **’ {aka ‘unsigned char **’}
224 | int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
../src/SDL/avi.c: In function ‘aviStart’:
../src/SDL/avi.c:429:79: error: passing argument 5 of ‘av_find_best_stream’ from incompatible pointer type [-Wincompatible-pointer-types]
429 | videoStream = av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_VIDEO, -1, -1, &pCodec, 0);
| ^~~~~~~
| |
| AVCodec **
In file included from ../src/SDL/avi.c:39:
/usr/include/libavformat/avformat.h:2113:48: note: expected ‘const struct AVCodec **’ but argument is of type ‘AVCodec **’
2113 | const struct AVCodec **decoder_ret,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~