I try c++1z feature to use std::experimental::filesystem
After adding -lstdc++fs flag with g++, I can see that I am able to link std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts() with my program.
i.e I am not getting this error anymore
sdc.cpp:(.text+0x7e5): undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts()'
However, even after linking, I get the following error.
g++ -std=c++1z timer.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out lib/libOpenTimer.a(spef.cpp.o): In function
spef::Spef::read(std::experimental::filesystem::v1::__cxx11::path const&)': spef.cpp:(.text._ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE[_ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE]+0x2e): undefined reference to
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)' lib/libOpenTimer.a(sdc.cpp.o): In functionot::sdc::home[abi:cxx11]()': sdc.cpp:(.text+0x414): undefined reference to
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)' sdc.cpp:(.text+0x7ab): undefined reference tostd::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)' lib/libOpenTimer.a(sdc.cpp.o): In function
ot::sdc::SDC::read(std::experimental::filesystem::v1::__cxx11::path const&)': sdc.cpp:(.text+0x2fa1): undefined reference tostd::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)' sdc.cpp:(.text+0x3084): undefined reference to
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)' sdc.cpp:(.text+0x30db): undefined reference tostd::experimental::filesystem::v1::current_path[abi:cxx11]()' sdc.cpp:(.text+0x30f7): undefined reference to
std::experimental::filesystem::v1::absolute(std::experimental::filesystem::v1::__cxx11::path const&, std::experimental::filesystem::v1::__cxx11::path const&)' sdc.cpp:(.text+0x3788): undefined reference tostd::experimental::filesystem::v1::remove(std::experimental::filesystem::v1::__cxx11::path const&)' lib/libOpenTimer.a(os.cpp.o): In function
ot::user_homeabi:cxx11': os.cpp:(.text+0x30d): undefined reference to `std::experimental::filesystem::v1::current_pathabi:cxx11' collect2: error: ld returned 1 exit status
Any help to resolve this would be much appreciated.