Build fails: 'alphasort' undeclared - MSYS2 - MinGW64
Brought to you by:
ddennedy,
lilo_booter
When attempting to build, with MSYS2 for x86_64-w64-mingw32, the build fails with:
make[2]: Entering directory '/c/src/64/mlt-6.0.0/src/modules/sdl'
cc -c -I../.. -DARCH_X86_64 -Wall -DPIC -O2 -pipe -fno-tree-dominator-opts -fno-tree-pre -ffast-math -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/mingw64/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main -DWITH_SDL_IMAGE -o producer_sdl_image.o producer_sdl_image.c
producer_sdl_image.c: In function 'parse_file_names':
producer_sdl_image.c:100:11: warning: implicit declaration of function 'scandir' [-Wimplicit-function-declaration]
int n = scandir( fullname, &de, filter_files, alphasort );
^
producer_sdl_image.c:100:49: error: 'alphasort' undeclared (first use in this function)
int n = scandir( fullname, &de, filter_files, alphasort );
^
producer_sdl_image.c:100:49: note: each undeclared identifier is reported only once for each function it appears in
producer_sdl_image.c:107:42: warning: implicit declaration of function 'lstat' [-Wimplicit-function-declaration]
if ( strstr( fullname, extension ) && lstat( fullname, &info ) == 0 &&
^
../../../config.mak:27: recipe for target 'producer_sdl_image.o' failed
make[2]: *** [producer_sdl_image.o] Error 1
make[2]: Leaving directory '/c/src/64/mlt-6.0.0/src/modules/sdl'
Makefile:5: recipe for target 'all' failed
make[1]: *** [all] Error 1
make[1]: Leaving directory '/c/src/64/mlt-6.0.0/src/modules'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 1
It looks like a possible fix is...
#define _GNU_SOURCE
...according to:
https://stackoverflow.com/questions/19439855/implicit-declaration-of-scandir-alphasort-is-undeclared
$ uname -a
MINGW64_NT-6.3 hp-sucks 2.5.0(0.295/5/3) 2016-03-15 11:29 x86_64 Msys
$ ./configure --prefix=/usr/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-gpl --disable-decklink --disable-debug --disable-frei0r --disable-jackrack --without-kde --disable-kdenlive --disable-kino