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

Fails to build (cannot convert ‘const string’ to ‘const char*’) #1306

Closed
wmww opened this issue Nov 3, 2021 · 2 comments
Closed

Comments

@wmww
Copy link

wmww commented Nov 3, 2021

On up to date Arch, I cloned, meson build and ninja -C build and got this.

wmww:Waybar$ ninja -C build
ninja: Entering directory `build'
[4/32] Compiling C++ object waybar.p/src_config.cpp.o
FAILED: waybar.p/src_config.cpp.o 
c++ -Iwaybar.p -I. -I.. -I../include -I../subprojects/spdlog-1.8.5/include -I../subprojects/date-3.0.0/include -Iprotocol -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/gtkmm-3.0 -I/usr/lib/gtkmm-3.0/include -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/include/pangomm-1.4 -I/usr/lib/pangomm-1.4/include -I/usr/include/atkmm-1.6 -I/usr/lib/atkmm-1.6/include -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib/gdkmm-3.0/include -I/usr/include/libdbusmenu-gtk3-0.4 -I/usr/include/libdbusmenu-glib-0.4 -I/usr/include/libnl3 -I/usr/include/libevdev-1.0/ -I/usr/include/gtk-layer-shell -I/usr/include/libxml2 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -O3 '-DVERSION="0.9.8-70-gb511103 (branch '"'"'master'"'"')"' -DHAVE_LANGINFO_1STDAY '-DSYSCONFDIR="//usr/local/etc"' -DHAVE_CPU_LINUX -DHAVE_MEMORY_LINUX -DHAVE_SWAY -DHAVE_WLR -DHAVE_RIVER -DHAVE_LIBNL -DHAVE_LIBPULSE -DHAVE_DBUSMENU -DHAVE_LIBUDEV -DHAVE_LIBEVDEV -DHAVE_GTK_LAYER_SHELL -DHAVE_LIBDATE -DUSE_OS_TZDB=1 -pthread -D_REENTRANT -DSPDLOG_FMT_EXTERNAL -MD -MQ waybar.p/src_config.cpp.o -MF waybar.p/src_config.cpp.o.d -o waybar.p/src_config.cpp.o -c ../src/config.cpp
In file included from ../subprojects/spdlog-1.8.5/include/spdlog/common.h:248,
                 from ../subprojects/spdlog-1.8.5/include/spdlog/spdlog.h:12,
                 from ../src/config.cpp:4:
../subprojects/spdlog-1.8.5/include/spdlog/common-inl.h: In constructor ‘spdlog::spdlog_ex::spdlog_ex(const string&, int)’:
../subprojects/spdlog-1.8.5/include/spdlog/common-inl.h:63:50: error: cannot convert ‘const string’ {aka ‘const std::__cxx11::basic_string<char>’} to ‘const char*’
   63 |     fmt::format_system_error(outbuf, last_errno, msg);
      |                                                  ^~~
      |                                                  |
      |                                                  const string {aka const std::__cxx11::basic_string<char>}
In file included from /usr/include/fmt/ostream.h:13,
                 from ../src/config.cpp:3:
/usr/include/fmt/format.h:2265:46: note:   initializing argument 3 of ‘void fmt::v8::format_system_error(fmt::v8::detail::buffer<char>&, int, const char*)’
 2265 |                                  const char* message) FMT_NOEXCEPT;
      |                                  ~~~~~~~~~~~~^~~~~~~

<it continues on with warnings, but the only other errors are repeats of this one>
@alebastr
Copy link
Contributor

alebastr commented Nov 3, 2021

../subprojects/spdlog-1.8.5 - that is an old version of spdlog that is not compatible with the current fmt. You'll need to either install both from the Arch repos or use both as subprojects.

@wmww
Copy link
Author

wmww commented Nov 3, 2021

Thanks! Installing spdlog from the Arch repos fixed it.

@wmww wmww closed this as completed Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants