GCC 9 adds C++17 std::filesystem support in libstdc++, from GGC 9 release notes
Using the types and functions in does not require linking with -lstdc++fs now.
src/MEGASync/mega/src/autocomplete.cpp has a test to use std::filesystem namespace instead of std::experimental::filesystem in case that CPP 17 is found.
This means that static linking against libstdc++fs.a is not needed if GCC version is 9 or newer, so I'm suggesting a change like the following.
GCC 9 adds C++17 std::filesystem support in libstdc++, from GGC 9 release notes
src/MEGASync/mega/src/autocomplete.cpp has a test to use
std::filesystem
namespace instead ofstd::experimental::filesystem
in case that CPP 17 is found.This means that static linking against
libstdc++fs.a
is not needed if GCC version is 9 or newer, so I'm suggesting a change like the following.The application seems to build and run fine with this change on Arch Linux and also when built as a Flatpak package with KDE 5.14 runtime.
This change needed for Flatpak as
libstdc++fs.a
is not shipped with the latest KDE 5.14 runtime.