giuspen / cherrytree

cherrytree
https://www.giuspen.net/cherrytree/
Other
3.34k stars 457 forks source link

No longer build on Arch Linux - Build error in spdlog/logger.h cannot bind non-const lvalue reference of type ‘Glib::ustring&’ to an rvalue of type ‘Glib::ustring’ #2332

Closed boussou closed 1 year ago

boussou commented 1 year ago

I always been able to build cherrytree v0.99.39

Now it no longer builds, no matter the version.

I tried on 1.0.0.r18, then back on 0.99.39

The error:

/usr/include/spdlog/logger.h:374:75: error: cannot bind non-const lvalue reference of type ‘Glib::ustring&’ to an rvalue of type ‘Glib::ustring’
  374 |             fmt::vformat_to(fmt::appender(buf), fmt, fmt::make_format_args(std::forward<Args>(args)...));
      |                      

what's different with spdlog library?

on arch it is version 1.11.0-3

giuspen commented 1 year ago

May be the same issue of https://github.com/giuspen/cherrytree/issues/2331 I will try first to build with the latest spdlog in my Ubuntu and if I cannot reproduce I'll set up a VM with ArchLinux

giuspen commented 1 year ago

Can you give me more stack of the error? It should point to a cc file, the h file is only the tip of the iceberg

giuspen commented 1 year ago

Can you pull the latest, git submodule update --init, edit https://github.com/giuspen/cherrytree/blob/master/CMakeLists.txt#L28 change ON to OFF for USE_SHARED_FMT_SPDLOG so the bundled version is used and build again?

boussou commented 1 year ago

I was about to send the log as you asked earlier: I will do both

Thank you

Meanwhile I tried to build spdlog 1.2, but you require 1.5, but I was unable to build the 1.5 and above.

boussou commented 1 year ago

on tag 1.0.0 commit 841ae8c6 here is the build log

Now i will try with USE_SHARED_FMT_SPDLOG OFF

logs.txt

boussou commented 1 year ago

USE_SHARED_FMT_SPDLOG

git submodule update --init

[nadir@inspired cherrytree]$ git submodule update --init
Submodule 'src/spdlog' (https://github.com/gabime/spdlog.git) registered for path 'src/spdlog'
Submodule 'tests/googletest' (https://github.com/google/googletest.git) registered for path 'tests/googletest'
Cloning into '/tmp/2023-08-18/cherrytree/src/spdlog'...
Cloning into '/tmp/2023-08-18/cherrytree/tests/googletest'...
Submodule path 'src/spdlog': checked out '7e635fca68d014934b4af8a1cf874f63989352b7'
Submodule path 'tests/googletest': checked out '9fce5480448488e17a50bcbf88d2f3bdb637ad6c'

then
OFF for USE_SHARED_FMT_SPDLOG

Build was successful.

You should put that in the README.md because the spdlog is so light then is very little advantage in using the system installed version. (Except breaking on system upgrade ^_^).

giuspen commented 1 year ago

Thanks for your tests @boussou I think there is an incompatibility issue between the version in use of spdlog and fmt in ArchLinux. I will write something in the README.md

boussou commented 1 year ago

Thanks for your reactivity and for this great utility