root
root copied to clipboard
Problems using `std::filesystem` in standalone `cling`
Description
libstdc++ provides std::filesystem symbols in a static archive libstdc++fs.a. This causes problems on some platforms because the linker might strip the symbols. See https://github.com/root-project/root/issues/11601 and the note on devtoolsets in https://root.cern/install/build_from_source/#caveats for instances of similar problems.
If a proper solution is found, the Cling test test/Prompt/ValuePrinter/FileSystemPath.C should be re-enabled (it was disabled in https://github.com/root-project/root/pull/16258).
Reproducer
Try to run in standalone cling:
#include <filesystem>
auto p = std::filesystem::path("/some/path/foo.cpp");
ROOT version
master
Installation method
from source
Operating system
Linux, with libstdc++
Additional context
It seems to work in ROOT itself.