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::absolute(std::filesystem::__cxx11::path const&)' #6889

Closed
Knindzagxg opened this issue Jul 11, 2021 · 8 comments · Fixed by #6914
Closed
Labels
CORE Related to the core

Comments

@Knindzagxg
Copy link
Member

Knindzagxg commented Jul 11, 2021

Current Behaviour

There are some weird issues while recompiling with Dashboard.
It was working fine, until i changed to clang 11.

For some unknown reason, during recompile, it wasn't able to find scripts in filesystems, even tho it's included in Updater.cpp

 undefined reference to `std::filesystem::absolute(std::filesystem::__cxx11::path const&)'

Except pastebin link bellow, i'm not sure what else to provide.

https://pastebin.com/df2r33ey

Expected Blizzlike Behaviour

Compile / Recompile should work.

Source

No response

Steps to reproduce the problem

  1. Update your clang to 11 - Debian 10.
  2. Try to compile / recompile trough Bash Dashboard.

Extra Notes

No response

AC rev. hash/commit

AzerothCore revision: 2e8a749+ 2021-07-10 17:18:23 +0200 (master branch)

Operating system

Debian 10 x64

Custom changes or Modules

No modules - Removed them.
Tried with clean build as well.

@FrancescoBorzi
Copy link
Member

@Viste @UltraNix any clue about this?

@FrancescoBorzi FrancescoBorzi changed the title Bash Dashboard setup - Recompile issues undefined reference to `std::filesystem::absolute(std::filesystem::__cxx11::path const&)' Jul 11, 2021
@Krejza9
Copy link
Contributor

Krejza9 commented Jul 11, 2021

this is boost problem
You must start compiling boost libraries first.

@Kitzunu
Copy link
Member

Kitzunu commented Jul 11, 2021

Why would it be an issue with Boost? We dont use boost::filesystem, we use std::filesystem

@iraizo
Copy link
Contributor

iraizo commented Jul 11, 2021

This is an issue because of the standard library from your system, its outdated and does not have the C++17 filesystem headers

@Viste
Copy link
Contributor

Viste commented Jul 11, 2021

ldd --version
and
lsof -p $$ | grep libstdc | awk ' { print $NF" --version"; } ' | sh
@iraizo is right i guess but need to check ;)

update

#!/bin/sh
echo "deb http://ftp.debian.org/debian sid main" >> /etc/apt/sources.list
apt-get update
apt-get -t sid install libc6 libc6-dev libc6-dbg libc++1 libc++1-11
echo "Please remember to hash out sid main from your sources list. /etc/apt/sources.list"

about last 2 packets i dont sure dont use debian(read like shit) for years

@FrancescoBorzi
Copy link
Member

Thanks @Viste

@Knindzagxg installed gcc-10 and that apparently solved the issue for him. I guess we can close this

@iraizo
Copy link
Contributor

iraizo commented Jul 12, 2021

Thanks @Viste

@Knindzagxg installed gcc-10 and that apparently solved the issue for him. I guess we can close this

Yep the gcc package automatically depends on the standard lib that also includes those.

@necropola
Copy link
Contributor

necropola commented Jul 12, 2021

Or just just add one line to fix the build on debian instead of installing an entire package which isn't even in debian stable (nor in backports):

diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 7a2997089..2db021ce5 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -62,6 +62,7 @@ target_link_libraries(common
     openssl
     threads
     jemalloc
+    stdc++fs
     fmt)

 set_target_properties(common

Since gcc-10 is not even in buster-backports you would need to install it from unstable (sid) which is something you should avoid like the plague on debian. See https://wiki.debian.org/DontBreakDebian

Honestly, ditch debian and install ArchLinux instead is a more sensible suggestion than to encourage users to break their stable debian system.

Maybe the following helps to fix the build system:

and in particular

necropola added a commit to necropola/azerothcore-wotlk that referenced this issue Jul 13, 2021
Kitzunu pushed a commit that referenced this issue Jul 17, 2021
* fix(CORE): Find std::filesystem across platforms
Closes #6889

* Squeeze blank lines to make check-codestyle happy

* Move find_package(Filesystem ...) to deps/stdfs

* CMAKE_CXX_STANDARD gets already set in ConfigureBaseTargets.cmake
@Azcobu Azcobu added the CORE Related to the core label Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CORE Related to the core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants