TerryCavanagh / VVVVVV

The source code to VVVVVV! http://thelettervsixtim.es/
Other
6.9k stars 553 forks source link

Build fails on physfs: #1167

Closed TheCycoONE closed 2 days ago

TheCycoONE commented 1 month ago

On Arch Linux with gcc 14.1.1 the build is failing on physfs. When I build physfs alone from it's repo on the same commit it works fine.

make -j5  
[  1%] Building C object CMakeFiles/c-hashmap-static.dir/home/family/projects/VVVVVV/third_party/c-hashmap/map.c.o
[  2%] Building C object CMakeFiles/faudio-static.dir/home/family/projects/VVVVVV/third_party/FAudio/src/FAudio.c.o
[  3%] Building C object CMakeFiles/lodepng-static.dir/src/lodepng_wrapper.c.o
[  4%] Building C object CMakeFiles/sheenbidi-static.dir/home/family/projects/VVVVVV/third_party/SheenBidi/Source/SheenBidi.c.o
-- This is interim commit 16d75d2d (committed 2024-05-25) on branch master
[  4%] Built target GenerateVersion
[  6%] Building C object CMakeFiles/faudio-static.dir/home/family/projects/VVVVVV/third_party/FAudio/src/FAudio_internal.c.o
[  7%] Linking C static library libc-hashmap-static.a
[  7%] Built target c-hashmap-static
[  8%] Building C object CMakeFiles/faudio-static.dir/home/family/projects/VVVVVV/third_party/FAudio/src/FAudio_internal_simd.c.o
[  9%] Building CXX object CMakeFiles/tinyxml2-static.dir/home/family/projects/VVVVVV/third_party/tinyxml2/tinyxml2.cpp.o
[ 11%] Building C object CMakeFiles/faudio-static.dir/home/family/projects/VVVVVV/third_party/FAudio/src/FAudio_operationset.c.o
[ 12%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs.c.o
[ 13%] Linking C static library libsheenbidi-static.a
[ 13%] Built target sheenbidi-static
[ 14%] Building C object CMakeFiles/faudio-static.dir/home/family/projects/VVVVVV/third_party/FAudio/src/FAudio_platform_sdl2.c.o
[ 16%] Building C object CMakeFiles/InterimVersion.dir/src/InterimVersion.out.c.o
[ 17%] Linking C static library libInterimVersion.a
[ 17%] Built target InterimVersion
[ 18%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_archiver_dir.c.o
[ 20%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_archiver_unpacked.c.o
[ 20%] Linking C static library liblodepng-static.a
[ 22%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_archiver_zip.c.o
[ 23%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_byteorder.c.o
[ 24%] Linking CXX static library libtinyxml2-static.a
[ 24%] Built target lodepng-static
[ 25%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_unicode.c.o
[ 25%] Built target tinyxml2-static
[ 27%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_unix.c.o
[ 28%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_posix.c.o
/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_unix.c: In function ‘readSymLink’:
/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_unix.c:230:15: error: implicit declaration of function ‘readlink’ [-Wimplicit-function-declaration]
  230 |          rc = readlink(path, retval, len);
      |               ^~~~~~~~
make[2]: *** [CMakeFiles/physfs-static.dir/build.make:174: CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_unix.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_posix.c: In function ‘__PHYSFS_platformStat’:
/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_posix.c:334:53: error: implicit declaration of function ‘lstat’; did you mean ‘fstat’? [-Wimplicit-function-declaration]
  334 |     const int rc = follow ? stat(fname, &statbuf) : lstat(fname, &statbuf);
      |                                                     ^~~~~
      |                                                     fstat
make[2]: *** [CMakeFiles/physfs-static.dir/build.make:160: CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_posix.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:288: CMakeFiles/physfs-static.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 29%] Linking C static library libfaudio-static.a
[ 29%] Built target faudio-static
make: *** [Makefile:91: all] Error 2
homeisfar commented 2 weeks ago

You can unset compliance with C99 in the cmakelists to get past this. Comment out lines 303 and 304 in desktop_version/CMakeLists.txt, produce a clean build directory, then compile. My preferred way:

mkdir build; cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4