Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
grommile

Build trouble on Debian 10 (buster)

Recommended Posts

Eternity currently seems to not build on Debian 10 (buster - the current, and very recently released, stable).

 

Everything compiles, but it blows up at link time:

 

[ 20%] Linking CXX executable eternity
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `D_CheckBasePath(qstring const&)':
d_files.cpp:(.text+0x12de): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: d_files.cpp:(.text+0x141e): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `D_CheckUserPath(qstring const&)':
d_files.cpp:(.text+0x1a8a): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: d_files.cpp:(.text+0x1baa): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `D_GameAutoloadWads()':
d_files.cpp:(.text+0x280b): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: d_files.cpp:(.text+0x2955): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `D_GameAutoloadDEH()':
d_files.cpp:(.text+0x2b17): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: d_files.cpp:(.text+0x2cd1): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `D_GameAutoloadCSC()':
d_files.cpp:(.text+0x2ec9): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: d_files.cpp:(.text+0x2ffe): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.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::format)':
d_files.cpp:(.text._ZNSt10filesystem7__cxx114pathC2EONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS1_6formatE[_ZNSt10filesystem7__cxx114pathC5EONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS1_6formatE]+0x4f): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `std::filesystem::__cxx11::path::clear()':
d_files.cpp:(.text._ZNSt10filesystem7__cxx114path5clearEv[_ZNSt10filesystem7__cxx114path5clearEv]+0x20): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `std::filesystem::__cxx11::operator==(std::filesystem::__cxx11::path const&, std::filesystem::__cxx11::path const&)':
d_files.cpp:(.text._ZNSt10filesystem7__cxx11eqERKNS0_4pathES3_[_ZNSt10filesystem7__cxx11eqERKNS0_4pathES3_]+0x1f): undefined reference to `std::filesystem::__cxx11::path::compare(std::filesystem::__cxx11::path const&) const'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `std::filesystem::__cxx11::path::extension() const':
d_files.cpp:(.text._ZNKSt10filesystem7__cxx114path9extensionEv[_ZNKSt10filesystem7__cxx114path9extensionEv]+0x19): undefined reference to `std::filesystem::__cxx11::path::_M_find_extension() const'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `std::filesystem::__cxx11::directory_entry::status() const':
d_files.cpp:(.text._ZNKSt10filesystem7__cxx1115directory_entry6statusEv[_ZNKSt10filesystem7__cxx1115directory_entry6statusEv]+0x14): undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&)'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `std::filesystem::__cxx11::directory_entry::symlink_status() const':
d_files.cpp:(.text._ZNKSt10filesystem7__cxx1115directory_entry14symlink_statusEv[_ZNKSt10filesystem7__cxx1115directory_entry14symlink_statusEv]+0x14): undefined reference to `std::filesystem::symlink_status(std::filesystem::__cxx11::path const&)'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&)':
d_files.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/eternity.dir/d_files.cpp.o: in function `std::filesystem::__cxx11::path::path<char const*, std::filesystem::__cxx11::path>(char const* const&, std::filesystem::__cxx11::path::format)':
d_files.cpp:(.text._ZNSt10filesystem7__cxx114pathC2IPKcS1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC5IPKcS1_EERKT_NS1_6formatE]+0x64): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_files.cpp.o: in function `std::filesystem::__cxx11::path::path<char [5], std::filesystem::__cxx11::path>(char const (&) [5], std::filesystem::__cxx11::path::format)':
d_files.cpp:(.text._ZNSt10filesystem7__cxx114pathC2IA5_cS1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC5IA5_cS1_EERKT_NS1_6formatE]+0x5e): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_findiwads.cpp.o: in function `D_addSubDirectories(Collection<qstring>&, char const*)':
d_findiwads.cpp:(.text+0x272): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: d_findiwads.cpp:(.text+0x3cf): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_findiwads.cpp.o: in function `D_checkPathForIWADs(qstring const&)':
d_findiwads.cpp:(.text+0xcca): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: d_findiwads.cpp:(.text+0xe7d): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_findiwads.cpp.o: in function `D_checkForNoRest()':
d_findiwads.cpp:(.text+0x11b1): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: d_findiwads.cpp:(.text+0x130e): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/d_findiwads.cpp.o: in function `std::filesystem::is_directory(std::filesystem::__cxx11::path const&, std::error_code&)':
d_findiwads.cpp:(.text._ZNSt10filesystem12is_directoryERKNS_7__cxx114pathERSt10error_code[_ZNSt10filesystem12is_directoryERKNS_7__cxx114pathERSt10error_code]+0x1f): undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&, std::error_code&)'
/usr/bin/ld: CMakeFiles/eternity.dir/d_findiwads.cpp.o: in function `std::filesystem::__cxx11::path::path<char*, std::filesystem::__cxx11::path>(char* const&, std::filesystem::__cxx11::path::format)':
d_findiwads.cpp:(.text._ZNSt10filesystem7__cxx114pathC2IPcS1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC5IPcS1_EERKT_NS1_6formatE]+0x64): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: CMakeFiles/eternity.dir/mn_files.cpp.o: in function `MN_ReadDirectory(mndir_s*, char const*, char const* const*, unsigned long, bool)':
mn_files.cpp:(.text+0x615): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: mn_files.cpp:(.text+0x817): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/mn_files.cpp.o: in function `std::filesystem::__cxx11::path::operator/=(std::filesystem::__cxx11::path const&)':
mn_files.cpp:(.text._ZNSt10filesystem7__cxx114pathdVERKS1_[_ZNSt10filesystem7__cxx114pathdVERKS1_]+0x3d): undefined reference to `std::filesystem::__cxx11::path::has_filename() const'
/usr/bin/ld: mn_files.cpp:(.text._ZNSt10filesystem7__cxx114pathdVERKS1_[_ZNSt10filesystem7__cxx114pathdVERKS1_]+0x98): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: CMakeFiles/eternity.dir/mn_files.cpp.o: in function `std::filesystem::__cxx11::path::is_absolute() const':
mn_files.cpp:(.text._ZNKSt10filesystem7__cxx114path11is_absoluteEv[_ZNKSt10filesystem7__cxx114path11is_absoluteEv]+0x14): undefined reference to `std::filesystem::__cxx11::path::has_root_directory() const'
/usr/bin/ld: CMakeFiles/eternity.dir/mn_files.cpp.o: in function `std::filesystem::exists(std::filesystem::__cxx11::path const&)':
mn_files.cpp:(.text._ZNSt10filesystem6existsERKNS_7__cxx114pathE[_ZNSt10filesystem6existsERKNS_7__cxx114pathE]+0x14): undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&)'
/usr/bin/ld: CMakeFiles/eternity.dir/mn_files.cpp.o: in function `std::filesystem::__cxx11::path::path<char [3], std::filesystem::__cxx11::path>(char const (&) [3], std::filesystem::__cxx11::path::format)':
mn_files.cpp:(.text._ZNSt10filesystem7__cxx114pathC2IA3_cS1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC5IA3_cS1_EERKT_NS1_6formatE]+0x5e): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: CMakeFiles/eternity.dir/w_wad.cpp.o: in function `WadDirectory::addDirectory(char const*)':
w_wad.cpp:(.text+0x1512): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: w_wad.cpp:(.text+0x164d): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/w_wad.cpp.o: in function `W_recurseFiles(Collection<ArchiveDirFile>&, char const*, char const*, Collection<qstring>&, int)':
w_wad.cpp:(.text+0x1cb2): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: w_wad.cpp:(.text+0x1f4e): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: CMakeFiles/eternity.dir/w_wad.cpp.o: in function `std::filesystem::__cxx11::directory_entry::file_size() const':
w_wad.cpp:(.text._ZNKSt10filesystem7__cxx1115directory_entry9file_sizeEv[_ZNKSt10filesystem7__cxx1115directory_entry9file_sizeEv]+0x14): undefined reference to `std::filesystem::file_size(std::filesystem::__cxx11::path const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [source/CMakeFiles/eternity.dir/build.make:3919: source/eternity] Error 1
make[1]: *** [CMakeFiles/Makefile2:366: source/CMakeFiles/eternity.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

 

Share this post


Link to post
Posted (edited)

Wait what? It should be fine. It looks like the compiler is set to C++11 for some reason when it comes to linking or something, even though this is in the CMakeLists.txt:

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   TRY_CXX_COMPILER_FLAG(-std=c++17 FLAG_CXX_stdcxx17)
endif()

I'm baffled. Do you need to separately download libstdc++ or something? Are you using g++ or Clang?

 

EDIT: Think I fixed it. Please re-run CMake and try again.

Edited by Altazimuth

Share this post


Link to post

After a bit of a poke around... whatever's blowing up is definitely a problem at my end or Debian's.

 

I wrote a simple test case invoking std::filesystem::directory_iterator and that doesn't work either.

 

Sorry for the noise.

Share this post


Link to post

Don't worry about it. This is a concern since I moved things to C++17 specifically because Buster was out, with versions of GCC and Clang that are capable of compiling C++17 code. If you manage to find out what the issue is please let me know. If it can't be fixed without having to compile a new GCC or install some package not in the apt or whatever also let me know, as at that point I'd probably just deal with this on EE's end.

 

Actually if you're using GCC then could you please test with Clang and vice versa? Could be a compiler error.

Share this post


Link to post

... Huh. Clang 7 explodes in exactly the same way on my test case.

 

I'll raise it in the Debian BTS, since it's obvious that something is busted in buster.

Share this post


Link to post
Posted (edited)

Please do. If it's not a bother I'd like to see the thread as it develop and would appreciate the link to it.

 

As per always, thanks for the report!

Share this post


Link to post

And we have a maintainer response:

 

"these are features marked as experimental, and you need to link with libstdc++fs.a."

 

Share this post


Link to post

squints

C++17 feature is experimental in C++17-compliant compilers? What? I'll look into fixing it in that case, however that's achieved.

Share this post


Link to post

I have the same problem which blocks the Mac builds. Maybe the solution here is as well to sideload the "experimental" filesystem library with Eternity until it becomes official.

Share this post


Link to post
15 hours ago, Altazimuth said:

squints

C++17 feature is experimental in C++17-compliant compilers? What? I'll look into fixing it in that case, however that's achieved.

I suspect the position is "the compiler is compliant, the standard library isn't yet".

Share this post


Link to post
Posted (edited)

Build fails in exactly the same way. It's not a source-level problem, it's a build script-level problem.

 

I'll have a go at tweaking CMakeLists.txt.

 

EDIT: OK. Got it to link and produce a working Eternity binary:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86f73cfa..5050cb28 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,6 +157,7 @@ endif()
 ######################### Compiler: Features  ##################################
 if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
    TRY_CXX_COMPILER_FLAG(-std=c++17 FLAG_CXX_stdcxx17)
+   find_library(FILESYSTEM_LIBRARY libstdc++fs.a PATHS /usr/lib/gcc/x86_64-linux-gnu/8 )
 endif()
 
 
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index bd7d71ee..94c1671a 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -127,6 +127,10 @@ if(MSVC)
    endif()
 endif()
 
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
+  target_link_libraries(eternity ${FILESYSTEM_LIBRARY})
+endif()
+
 if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
   target_link_libraries(eternity version)
 endif()

When I don't have inflamed sinuses, I'll have a look at writing the find_library line properly.

Edited by grommile : adding diff of filthy CMakeLists hacks

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×