PlotFS icon indicating copy to clipboard operation
PlotFS copied to clipboard

Compile error on Debian 10

Open ab0tj opened this issue 2 years ago • 0 comments

I ran into a compile error when trying to compile on Debian 10:

[ 83%] Linking CXX executable plotfs /usr/bin/ld: CMakeFiles/plotfs.dir/cli.cpp.o: in function 'main': cli.cpp:(.text+0x203d): undefined reference to 'std::filesystem::remove(std::filesystem::__cxx11::path const&, std::error_code&)' /usr/bin/ld: CMakeFiles/plotfs.dir/cli.cpp.o: in function 'std::filesystem::__cxx11::path::path<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::filesystem::__cxx11::path>(std::__cxx11::basic_string<ch ar, std::char_traits<char>, std::allocator<char> > const&, std::filesystem::__cxx11::path::format)': cli.cpp:(.text._ZNSt10filesystem7__cxx114pathC2INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC5INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES1_EERKT_NS1_6formatE]+0x64): undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/plotfs.dir/build.make:88: plotfs] Error 1 make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/plotfs.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

After researching what others did to fix this, I found that I was able to fix it by adding the following line to CMakeLists.txt:

target_link_libraries(plotfs stdc++fs)

ab0tj avatar Apr 05 '22 19:04 ab0tj