Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error on Debian 10 #12

Open
ab0tj opened this issue Apr 5, 2022 · 0 comments
Open

Compile error on Debian 10 #12

ab0tj opened this issue Apr 5, 2022 · 0 comments

Comments

@ab0tj
Copy link

ab0tj commented Apr 5, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant