supertux
supertux copied to clipboard
support older Linux/macOS platforms w/o std:: filesystem
From what I've heard, you should just need to copy Prism Launcher's implementation like so: https://github.com/PrismLauncher/PrismLauncher/commit/c520faed6d0e5e9472622f848ad8512b6c71c8e0
Currently, trying to build from source on - for example - Ubuntu 18.04 will result in the following:
[ 71%] Building CXX object CMakeFiles/supertux2_lib.dir/src/supertux/main.cpp.o /home/kirbyking/supertux/src/supertux/main.cpp:21:10: fatal error: filesystem: No such file or directory
#include <filesystem>
^~~~~~~~~~~~
compilation terminated.
CMakeFiles/supertux2_lib.dir/build.make:4851: recipe for target 'CMakeFiles/supertux2_lib.dir/src/supertux/main.cpp.o' failed
make[2]: *** [CMakeFiles/supertux2_lib.dir/src/supertux/main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:332: recipe for target 'CMakeFiles/supertux2_lib.dir/all' failed
make[1]: *** [CMakeFiles/supertux2_lib.dir/all] Error 2
Makefile:155: recipe for target 'all' failed
make: *** [all] Error 2
SuperTux requires compiler supporting C++17.
SuperTux requires compiler supporting C++17.
its a misconception that C++17 support implies the presence of #include <filesystem>
gcc-7 and gcc-8 are available on bionic, support C++17 in every other sense, yet do not have #include <filesystem>
I remember compiling for ubuntu 18. I was using an old i386 asus laptop. I installed g++ 8, used it, and it worked. But I'm not entirely sure if that's how it went. I might've added some ppa.
its a misconception that C++17 support implies the presence of
#include <filesystem>gcc-7 and gcc-8 are available on bionic, support C++17 in every other sense, yet do not have#include <filesystem>
I believe kubax meant you need a compiler that supports most of the C++17 specification, with a hard requirement of an std::filesystem implementation.
I believe gcc-7 and gcc-8 do technically have these, if not directly available, then they are probably locked behind both a compiler flag (-lstdc++fs) and an experimental header (#include <experimental/filesystem>)
Actually just checked, gcc-8 supports C++17's std::filesystem out of the box.
its a misconception that C++17 support implies the presence of
#include <filesystem>
Well if compiler doesn't provide complete C++17 implementation then we cannot do anything about that. You can try doing what @tulpenkiste mentioned.