Linker Error with experimental::filesystem
When attempting to implement C 1z features using the experimental::filesystem library in GCC 6.0, users may encounter a linker error. The error message indicates an undefined reference to std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts().
Reason:
The Filesystem TS is not a part of C 1z but a separate specification. GCC's implementation of this library is available in C 11 mode.
Solution:
To resolve this issue, link with -lstdc fs. The libstdc fs.a library must come after objects that depend on it in the linker command.
Updates:
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3