chia-log-analysis icon indicating copy to clipboard operation
chia-log-analysis copied to clipboard

GCC 8 not supported

Open pacio5 opened this issue 3 years ago • 2 comments

When running the last build command on debian 10, version gcc 8.

I get the following error

utente@debian:~/chia-log-analysis$ cmake --build build --config Release [ 25%] Linking CXX executable chia-log-analysis /usr/bin/ld: CMakeFiles/chia-log-analysis.dir/main.cpp.o: in function main': main.cpp:(.text+0x1ab): undefined reference to std::filesystem::file_size(std::filesystem::__cxx11::path const&)' /usr/bin/ld: main.cpp:(.text+0x434): undefined reference to std::filesystem::__cxx11::directory_iterator::operator*() const' /usr/bin/ld: main.cpp:(.text+0x14c7): undefined reference to std::filesystem::__cxx11::directory_iterator::operator++()' /usr/bin/ld: CMakeFiles/chia-log-analysis.dir/main.cpp.o: in function std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&)': main.cpp:(.text._ZNSt10filesystem7__cxx1118directory_iteratorC2ERKNS0_4pathE[_ZNSt10filesystem7__cxx1118directory_iteratorC5ERKNS0_4pathE]+0x26): undefined reference to std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*)' /usr/bin/ld: CMakeFiles/chia-log-analysis.dir/main.cpp.o: in function std::filesystem::__cxx11::path::path<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::filesystem::__cxx11::path>(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::filesystem::__cxx11::path::format)': main.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()' /usr/bin/ld: CMakeFiles/chia-log-analysis.dir/InputHandler.cpp.o: in function std::filesystem::is_directory(std::filesystem::__cxx11::path const&)': InputHandler.cpp:(.text._ZNSt10filesystem12is_directoryERKNS_7__cxx114pathE[_ZNSt10filesystem12is_directoryERKNS_7__cxx114pathE]+0x14): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/chia-log-analysis.dir/build.make:114: chia-log-analysis] Error 1 make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/chia-log-analysis.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

pacio5 avatar May 22 '21 00:05 pacio5

Looks like GCC 8 needs a special flag to enable support for the <filesystem> header that Chia Log Analysis uses. I'll see if there's a way to have that flag set by default. I'm away from my PC for the weekend so won't be able to look into it for a while, but there might be a way to tell CMake how to pass the -lstdc++fs flag to the compiler in the meantime. You could also upgrade to a newer version of GCC but I know that's not always practical!

Pengor avatar May 22 '21 01:05 Pengor

I proposed a solution in the pull requests. I tried it on my debian 10 with gcc8 and it works.

When you can take a look at it.

pacio5 avatar May 22 '21 02:05 pacio5