Build error with fmt 11.0.0+
Building DHTNet with a recent version (>=11.0.0) of the fmt library produces the following errors:
[ 1%] Building CXX object CMakeFiles/dhtnet.dir/src/ice_transport.cpp.o
/opt/dhtnet/src/ice_transport.cpp: In member function ‘bool dhtnet::IceTransport::startIce(const Attribute&, std::vector<pj_ice_sess_cand>&&)’:
/opt/dhtnet/src/ice_transport.cpp:1325:22: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1325 | fmt::ptr(pimpl_),
| ~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/memory:78,
from /opt/dhtnet/include/ice_options.h:24,
from /opt/dhtnet/include/ice_transport.h:19,
from /opt/dhtnet/src/ice_transport.cpp:17:
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1325:22: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1325 | fmt::ptr(pimpl_),
| ~~~~~~~~^~~~~~~~
In file included from /usr/include/fmt/core.h:5,
from /opt/dhtnet/include/pj_init_lock.h:19,
from /opt/dhtnet/include/ice_transport_factory.h:22,
from /opt/dhtnet/src/ice_transport.cpp:18:
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp: In member function ‘bool dhtnet::IceTransport::startIce(const dhtnet::SDP&)’:
/opt/dhtnet/src/ice_transport.cpp:1358:94: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1358 | pimpl_->logger_->error(FMT_STRING("[ice:{}] not initialized transport"), fmt::ptr(pimpl_));
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1358:94: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1358 | pimpl_->logger_->error(FMT_STRING("[ice:{}] not initialized transport"), fmt::ptr(pimpl_));
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp:1368:30: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1368 | fmt::ptr(pimpl_), cand, id);
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1368:30: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1368 | fmt::ptr(pimpl_), cand, id);
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp:1374:22: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1374 | fmt::ptr(pimpl_), sdp.candidates.size());
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1374:22: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1374 | fmt::ptr(pimpl_), sdp.candidates.size());
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp:1394:75: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1394 | pimpl_->logger_->error("[ice:{}] start failed: {:s}", fmt::ptr(pimpl_), sip_utils::sip_strerror(status));
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1394:75: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1394 | pimpl_->logger_->error("[ice:{}] start failed: {:s}", fmt::ptr(pimpl_), sip_utils::sip_strerror(status));
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp: In member function ‘std::vector<std::__cxx11::basic_string<char> > dhtnet::IceTransport::getLocalCandidates(unsigned int) const’:
/opt/dhtnet/src/ice_transport.cpp:1448:90: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1448 | pimpl_->logger_->error("[ice:{}] pj_ice_strans_enum_cands() failed", fmt::ptr(pimpl_));
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1448:90: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1448 | pimpl_->logger_->error("[ice:{}] pj_ice_strans_enum_cands() failed", fmt::ptr(pimpl_));
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp: In member function ‘std::vector<std::__cxx11::basic_string<char> > dhtnet::IceTransport::getLocalCandidates(unsigned int, unsigned int) const’:
/opt/dhtnet/src/ice_transport.cpp:1517:90: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1517 | pimpl_->logger_->error("[ice:{}] pj_ice_strans_enum_cands() failed", fmt::ptr(pimpl_));
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1517:90: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1517 | pimpl_->logger_->error("[ice:{}] pj_ice_strans_enum_cands() failed", fmt::ptr(pimpl_));
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp: In member function ‘bool dhtnet::IceTransport::parseIceAttributeLine(unsigned int, const std::string&, dhtnet::IceCandidate&) const’:
/opt/dhtnet/src/ice_transport.cpp:1590:89: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1590 | pimpl_->logger_->error("[ice:{}] Invalid ICE candidate line: {:s}", fmt::ptr(pimpl_), line);
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1590:89: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1590 | pimpl_->logger_->error("[ice:{}] Invalid ICE candidate line: {:s}", fmt::ptr(pimpl_), line);
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp:1610:92: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1610 | pimpl_->logger_->warn("[ice:{}] invalid remote candidate type '{:s}'", fmt::ptr(pimpl_), type);
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1610:92: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1610 | pimpl_->logger_->warn("[ice:{}] invalid remote candidate type '{:s}'", fmt::ptr(pimpl_), type);
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp:1623:94: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1623 | pimpl_->logger_->warn("[ice:{}] invalid transport type type '{:s}'", fmt::ptr(pimpl_), tcp_type);
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1623:94: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1623 | pimpl_->logger_->warn("[ice:{}] invalid transport type type '{:s}'", fmt::ptr(pimpl_), tcp_type);
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp:1651:81: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1651 | pimpl_->logger_->warn("[ice:{}] invalid IP address '{:s}'", fmt::ptr(pimpl_), ipaddr);
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1651:81: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1651 | pimpl_->logger_->warn("[ice:{}] invalid IP address '{:s}'", fmt::ptr(pimpl_), ipaddr);
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp: In member function ‘ssize_t dhtnet::IceTransport::send(unsigned int, const unsigned char*, size_t)’:
/opt/dhtnet/src/ice_transport.cpp:1725:105: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1725 | pimpl_->logger_->error("[ice:{}] Unable to find remote address for component {:d}", fmt::ptr(pimpl_), compId);
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1725:105: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1725 | pimpl_->logger_->error("[ice:{}] Unable to find remote address for component {:d}", fmt::ptr(pimpl_), compId);
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp:1761:82: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1761 | pimpl_->logger_->error("[ice:{}] ice send failed: {:s}", fmt::ptr(pimpl_), sip_utils::sip_strerror(status));
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1761:82: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1761 | pimpl_->logger_->error("[ice:{}] ice send failed: {:s}", fmt::ptr(pimpl_), sip_utils::sip_strerror(status));
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
/opt/dhtnet/src/ice_transport.cpp: In member function ‘dhtnet::ICESDP dhtnet::IceTransport::parseIceCandidates(std::string_view)’:
/opt/dhtnet/src/ice_transport.cpp:1810:34: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = dhtnet::IceTransport::Impl; _Dp = std::default_delete<dhtnet::IceTransport::Impl>]’
1810 | fmt::ptr(pimpl_),
| ~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:516:7: note: declared here
516 | unique_ptr(const unique_ptr&) = delete;
| ^~~~~~~~~~
/opt/dhtnet/src/ice_transport.cpp:1810:34: note: use ‘-fdiagnostics-all-candidates’ to display considered candidates
1810 | fmt::ptr(pimpl_),
| ~~~~~~~~^~~~~~~~
/usr/include/fmt/format.h:4018:34: note: initializing argument 1 of ‘const void* fmt::v11::ptr(T) [with T = std::unique_ptr<dhtnet::IceTransport::Impl>]’
4018 | template <typename T> auto ptr(T p) -> const void* {
| ~~^
make[2]: *** [CMakeFiles/dhtnet.dir/build.make:90: CMakeFiles/dhtnet.dir/src/ice_transport.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:865: CMakeFiles/dhtnet.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
This is due to code being moved from fmt/format.h
to fmt/std.h
, see: https://github.com/fmtlib/fmt/commit/fd87a23d34e1df139ac511c9bbcfdda1ba59a232