[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#932546: marked as done (g++-8 fails to build C++17 programs that use std::filesystem)



Your message dated Sat, 20 Jul 2019 20:54:40 +0200
with message-id <[🔎] 52091728-fb5a-b0c5-252f-61a8cab4bc0d@debian.org>
and subject line Re: Bug#932548: g++-8: g++ fails to compile C++17 programs that use std::filesystem::directory_iterator
has caused the Debian Bug report #932548,
regarding g++-8 fails to build C++17 programs that use std::filesystem
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
932548: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932548
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: g++-8
Version: 8.3.0-6
Severity: important

Dear Maintainer,

* What led up to the situation?

Using std::filesystem::directory_iterator in a C++17 program.

* What exactly did you do (or not do) that was effective (or ineffective)?

Compile and link the program.

Originally I was trying to build third-party free software, but I wrote
a trivial test case that demonstrates the same behaviour to eliminate
potential CMake configuration issues in the third-party software from
consideration. Here follows the test case source code, called "foo.cc":

#include <filesystem>
#include <string>

int main()
{
    std::filesystem::directory_iterator bob(".");
    for (auto p = begin(bob); p != end(bob); ++p)
    {
        printf("%s\n", p->path().c_str());
    }
    return 0;
}

* What was the outcome of this action?

"g++ -std=c++17 foo.cc" failed at the linking step; shell transcript
follows:

mormegil@phlegethon:~/src/native/foo$ g++ -std=c++17 foo.cc
/usr/bin/ld: /tmp/ccjRDL0f.o: in function `main':
foo.cc:(.text+0x123): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: /tmp/ccjRDL0f.o: in function `std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&)':
foo.cc:(.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: /tmp/ccjRDL0f.o: in function `std::filesystem::__cxx11::directory_iterator::operator->() const':
foo.cc:(.text._ZNKSt10filesystem7__cxx1118directory_iteratorptEv[_ZNKSt10filesystem7__cxx1118directory_iteratorptEv]+0x14): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: /tmp/ccjRDL0f.o: in function `std::filesystem::__cxx11::path::path<char [2], std::filesystem::__cxx11::path>(char const (&) [2], std::filesystem::__cxx11::path::format)':
foo.cc:(.text._ZNSt10filesystem7__cxx114pathC2IA2_cS1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC5IA2_cS1_EERKT_NS1_6formatE]+0x5e): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
collect2: error: ld returned 1 exit status
mormegil@phlegethon:~/src/native/foo$ 

* What outcome did you expect instead?

I expected g++ to compile and link my test case included in this email
and also to compile and link the large third-party free software package
(the Eternity Engine, a fork of the libre source code for Doom).

-- System Information:
Debian Release: 10.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-5-amd64 (SMP w/12 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages g++-8 depends on:
ii  gcc-8            8.3.0-6
ii  gcc-8-base       8.3.0-6
ii  libc6            2.28-10
ii  libgmp10         2:6.1.2+dfsg-4
ii  libisl19         0.20-2
ii  libmpc3          1.1.0-1
ii  libmpfr6         4.0.2-1
ii  libstdc++-8-dev  8.3.0-6
ii  zlib1g           1:1.2.11.dfsg-1

g++-8 recommends no packages.

Versions of packages g++-8 suggests:
pn  g++-8-multilib    <none>
pn  gcc-8-doc         <none>
pn  libstdc++6-8-dbg  <none>

-- no debconf information

--- End Message ---
--- Begin Message ---
On 20.07.19 15:54, martin read wrote:
> Package: g++-8
> Version: 8.3.0-6
> Severity: important
> 
> Dear Maintainer,
> 
> * What led up to the situation?
> 
> Using std::filesystem::directory_iterator in a C++17 program.

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

--- End Message ---

Reply to: