Comment 5 for bug 1824721

Revision history for this message
Matthias Klose (doko) wrote :

there is a link error with:

$ g++-8 -static-libstdc++ -std=c++17 -lstdc++fs -g3 -o testpath testpath.cpp
/usr/bin/ld: /tmp/ccWrH4Ho.o: in function `std::filesystem::__cxx11::path::path<char [5], std::filesystem::__cxx11::path>(char const (&) [5], std::filesystem::__cxx11::path::format)':
/usr/include/c++/8/bits/fs_path.h:184: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
collect2: error: ld returned 1 exit status

you won't see it with dynamic linking because in 9, the code from libstdc++fs is now integrated in the libstdc++ library.