[llvm-bugs] [Bug 39193] New: std::filesystem::path::compare fails to link

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 5 13:11:21 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=39193

            Bug ID: 39193
           Summary: std::filesystem::path::compare fails to link
           Product: libc++
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vanboxem.ruben at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

This simple example program fails to compile with Clang/libc++ 7.0.0:

clang++ -stdlib=libc++ -std=c++17 main.c++
---
#include <filesystem>
#include <iostream>

int main()
{
    std::filesystem::path p("/home");

    auto p2 = p;

    if(p == p2)
        std::cout << "yay\n";
}
---

The errors I get are:
/usr/bin/ld: /tmp/main-da17c3.o: in function `main':
main.c++:(.text+0x31d): undefined reference to
`std::__1::__fs::filesystem::path::__compare(std::__1::basic_string_view<char,
std::__1::char_traits<char> >) const'
clang-7: error: linker command failed with exit code 1 (use -v to see
invocation)

Nothing changes if I
 - add -lc++experimental (it seems std::filesystem has moved to plain libc++ in
7.0?)
 - compile and link in separate steps

This worked fine with Clang/libc++ 6.0.1 before.
All this is on Arch Linux.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181005/f9ecf88a/attachment.html>


More information about the llvm-bugs mailing list