supertux icon indicating copy to clipboard operation
supertux copied to clipboard

support older Linux/macOS platforms w/o std:: filesystem

Open cobalt2727 opened this issue 1 year ago • 7 comments

From what I've heard, you should just need to copy Prism Launcher's implementation like so: https://github.com/PrismLauncher/PrismLauncher/commit/c520faed6d0e5e9472622f848ad8512b6c71c8e0

cobalt2727 avatar Dec 07 '23 01:12 cobalt2727

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 

cobalt2727 avatar Dec 07 '23 01:12 cobalt2727

SuperTux requires compiler supporting C++17.

mrkubax10 avatar Dec 07 '23 13:12 mrkubax10

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>

theofficialgman avatar Dec 08 '23 02:12 theofficialgman

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.

MatusGuy avatar Dec 08 '23 08:12 MatusGuy

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>)

tulpenkiste avatar Dec 08 '23 10:12 tulpenkiste

Actually just checked, gcc-8 supports C++17's std::filesystem out of the box.

tulpenkiste avatar Dec 08 '23 10:12 tulpenkiste

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.

mrkubax10 avatar Dec 08 '23 17:12 mrkubax10