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

undefined reference to `std::filesystem::create_directories(std::filesystem::__cxx11::path const&)' #43

Closed
patrickw99 opened this issue Jun 1, 2020 · 4 comments

Comments

@patrickw99
Copy link

I have been trying to compile this with the following version of gcc
gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1)

I have been getting the following error when I compile it. I have compiled it on both linux mint and on the raspberry pi running Raspbian. I get the same error. Do you have any ideas.

g++ -Werror -std=c++17 -DDATADIR=""/usr/local/share"" -o neoleo basic.o cell.o cmd.o convert.o errors.o format.o input.o io-2019.o io-headless.o io-curses.o io-edit.o io-term.o io-utils.o logging.o oleofile.o parser-2019.o ref.o regions.o sheet.o spans.o tbl.o utils.o window.o main.o tests.o value.o -lm -lncurses -ltinfo -lpanel -lform
/usr/bin/ld: logging.o: in function Log::Log()': logging.cc:(.text+0x90): undefined reference to std::filesystem::create_directories(std::filesystem::__cxx11::path const&)'
/usr/bin/ld: logging.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<char, std::char_traits<char>, std::allocator<char> > const&, std::filesystem::__cxx11::path::format)': logging.cc:(.text._ZNSt10filesystem7__cxx114pathC2INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC5INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES1_EERKT_NS1_6formatE]+0x60): undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:435: neoleo] Error 1

@blippy
Copy link
Owner

blippy commented Jun 1, 2020

My suspicion is that with an older compiler like 8.3.0, you need to add an extra compile flag like -lstdc++fs (unconfirmed), as they don't implement the full C++17 standard. I will investigate the problem and get back to you.

@blippy
Copy link
Owner

blippy commented Jun 1, 2020

Here's a fix:

make clean
env LIBS=-lstdc++fs ./configure
make

I'll note these instructions in installation notes. I'm reluctant to incorporate this fix in with configure.ac because I consider the g++ 8.3.0 "outdated". My inclination is therefore to let a maintainer provide tweaks to the system until a more modern compiler is released, whereupon the problem will vanish.

Is that a satisfactory response for you?

@blippy
Copy link
Owner

blippy commented Jun 12, 2020

The fix works for me. Since there has been no response from original poster, I will close this issue.

@blippy blippy closed this as completed Jun 12, 2020
@stefanhusmann
Copy link

This workaround (LIBS=-lstdc++fs) works for me with gcc 8.4.0 from Arch Linux' community repo.

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

3 participants