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

Can't building successful #84

Open
luacy200820 opened this issue Oct 13, 2023 · 6 comments
Open

Can't building successful #84

luacy200820 opened this issue Oct 13, 2023 · 6 comments

Comments

@luacy200820
Copy link

My g++ version is 11.4. I wanted to build sdbusplus library on Ubuntu. I got some error when I committed ninja. How can I successfully build on Ubuntu?

Some error message:
../include/sdbusplus/asio/object_server.hpp: In member function ‘bool sdbusplus::asio::dbus_interface::register_signal(const string&)’: ../include/sdbusplus/asio/object_server.hpp:575:13: error: there are no arguments to ‘sd_bus_member_name_is_valid’ that depend on a template parameter, so a declaration of ‘sd_bus_member_name_is_valid’ must be available [-fpermissive] 575 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In member function ‘bool sdbusplus::asio::dbus_interface::initialize(bool)’: ../include/sdbusplus/asio/object_server.hpp:752:38: error: ‘SD_BUS_VTABLE_ABSOLUTE_OFFSET’ was not declared in this scope 752 | element.flags_ | SD_BUS_VTABLE_ABSOLUTE_OFFSET)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp:759:38: error: ‘SD_BUS_VTABLE_ABSOLUTE_OFFSET’ was not declared in this scope 759 | element.flags_ | SD_BUS_VTABLE_ABSOLUTE_OFFSET)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp:770:34: error: ‘SD_BUS_VTABLE_ABSOLUTE_OFFSET’ was not declared in this scope 770 | element.flags_ | SD_BUS_VTABLE_ABSOLUTE_OFFSET)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_r(const string&, const PropertyType&, uint64_t, CallbackTypeGet&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackTypeGet = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:50&)>; std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:438:35: required from ‘bool sdbusplus::asio::dbus_interface::register_property_r(const string&, uint64_t, CallbackTypeGet&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackTypeGet = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:50&)>; std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’ ../example/get-all-properties.cpp:29:48: required from here ../include/sdbusplus/asio/object_server.hpp:412:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 412 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const string&, const PropertyType&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackTypeSet = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:51&, const auto:52&)>; CallbackTypeGet = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:53&)>; std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:485:36: required from ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const string&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackTypeSet = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:51&, const auto:52&)>; CallbackTypeGet = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:53&)>; std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’ ../example/get-all-properties.cpp:33:49: required from here ../include/sdbusplus/asio/object_server.hpp:455:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 455 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_r(const string&, const PropertyType&, uint64_t, CallbackTypeGet&&) [with PropertyType = unsigned int; CallbackTypeGet = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:54&)>; std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:438:35: required from ‘bool sdbusplus::asio::dbus_interface::register_property_r(const string&, uint64_t, CallbackTypeGet&&) [with PropertyType = unsigned int; CallbackTypeGet = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:54&)>; std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’ ../example/get-all-properties.cpp:41:45: required from here ../include/sdbusplus/asio/object_server.hpp:412:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 412 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: At global scope: ../include/sdbusplus/asio/object_server.hpp:296:5: error: ‘sdbusplus::asio::callback_get_instance<PropertyType, CallbackType>::callback_get_instance(const std::shared_ptr<_Tp>&, CallbackType&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackType = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:50&)>]’, declared using local type ‘Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:50&)>’, is used but never defined [-fpermissive] 296 | callback_get_instance(const std::shared_ptr<PropertyType>& value, | ^~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp:296:5: error: ‘sdbusplus::asio::callback_get_instance<PropertyType, CallbackType>::callback_get_instance(const std::shared_ptr<_Tp>&, CallbackType&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackType = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:53&)>]’, declared using local type ‘Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:53&)>’, is used but never defined [-fpermissive] In file included from /usr/include/c++/11/functional:59, from /usr/include/boost/asio/detail/functional.hpp:20, from /usr/include/boost/asio/associated_allocator.hpp:21, from /usr/include/boost/asio/detail/handler_alloc_helpers.hpp:23, from /usr/include/boost/asio/detail/bind_handler.hpp:20, from /usr/include/boost/asio/detail/wrapped_handler.hpp:18, from /usr/include/boost/asio/io_context.hpp:25, from ../example/get-all-properties.cpp:1: /usr/include/c++/11/bits/std_function.h:435:9: error: ‘std::function<_Res(_ArgTypes ...)>::function(_Functor&&) [with _Functor = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:51&, const auto:52&)>; _Constraints = void; _Res = bool; _ArgTypes = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&}]’, declared using local type ‘Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:51&, const auto:52&)>’, is used but never defined [-fpermissive] 435 | function(_Functor&& __f) | ^~~~~~~~ In file included from ../example/get-all-properties.cpp:4: ../include/sdbusplus/asio/object_server.hpp:296:5: error: ‘sdbusplus::asio::callback_get_instance<PropertyType, CallbackType>::callback_get_instance(const std::shared_ptr<_Tp>&, CallbackType&&) [with PropertyType = unsigned int; CallbackType = Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:54&)>]’, declared using local type ‘Application::Application(sdbusplus::asio::connection&, sdbusplus::asio::object_server&)::<lambda(const auto:54&)>’, is used but never defined [-fpermissive] 296 | callback_get_instance(const std::shared_ptr<PropertyType>& value, | ^~~~~~~~~~~~~~~~~~~~~ [32/89] Compiling C++ object test/test-async_context.p/async_context.cpp.o FAILED: test/test-async_context.p/async_context.cpp.o c++ -Itest/test-async_context.p -Itest -I../test -I../subprojects/googletest/googletest/include -I../subprojects/googletest/googletest -Isubprojects/googletest/__CMake_build -I../subprojects/googletest/__CMake_build -Isubprojects/googletest -I../subprojects/googletest -I../subprojects/googletest/googlemock/include -I../subprojects/googletest/googlemock -I../include -I/usr/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c++20 -O2 -g -DBOOST_ASIO_DISABLE_THREADS -DBOOST_ALL_NO_LIB -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -pthread -isystem../subprojects/googletest/googletest -isystem../subprojects/googletest/googletest/include -MD -MQ test/test-async_context.p/async_context.cpp.o -MF test/test-async_context.p/async_context.cpp.o.d -o test/test-async_context.p/async_context.cpp.o -c ../test/async/context.cpp In file included from ../include/sdbusplus/async/match.hpp:4, from ../include/sdbusplus/async.hpp:5, from ../test/async/context.cpp:1: ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::type::signal()’: ../include/sdbusplus/bus/match.hpp:62:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::type::signal()’ 62 | constexpr auto signal() noexcept | ^~~~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/stdexcept:39, from /usr/include/c++/11/system_error:41, from /usr/include/c++/11/bits/std_mutex.h:39, from /usr/include/c++/11/bits/atomic_wait.h:49, from /usr/include/c++/11/bits/atomic_base.h:41, from /usr/include/c++/11/atomic:41, from ../include/sdbusplus/async/stdexec/../stdexec/__detail/__intrusive_ptr.hpp:21, from ../include/sdbusplus/async/stdexec/../stdexec/execution.hpp:19, from ../include/sdbusplus/async/stdexec/async_scope.hpp:19, from ../include/sdbusplus/async/execution.hpp:11, from ../include/sdbusplus/async/context.hpp:3, from ../include/sdbusplus/async.hpp:3, from ../test/async/context.cpp:1: /usr/include/c++/11/bits/basic_string.h:85:11: note: ‘std::__cxx11::basic_string<char>’ is not literal because: 85 | class basic_string | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:85:11: note: ‘std::__cxx11::basic_string<char>’ does not have ‘constexpr’ destructor In file included from ../include/sdbusplus/async/match.hpp:4, from ../include/sdbusplus/async.hpp:5, from ../test/async/context.cpp:1: ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::type::method()’: ../include/sdbusplus/bus/match.hpp:66:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::type::method()’ 66 | constexpr auto method() noexcept | ^~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::type::method_return()’: ../include/sdbusplus/bus/match.hpp:70:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::type::method_return()’ 70 | constexpr auto method_return() noexcept | ^~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::type::error()’: ../include/sdbusplus/bus/match.hpp:74:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::type::error()’ 74 | constexpr auto error() noexcept | ^~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::sender(std::string_view)’: ../include/sdbusplus/bus/match.hpp:81:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::sender(std::string_view)’ 81 | constexpr auto sender(std::string_view s) noexcept | ^~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::interface(std::string_view)’: ../include/sdbusplus/bus/match.hpp:85:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::interface(std::string_view)’ 85 | constexpr auto interface(std::string_view s) noexcept | ^~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::member(std::string_view)’: ../include/sdbusplus/bus/match.hpp:89:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::member(std::string_view)’ 89 | constexpr auto member(std::string_view s) noexcept | ^~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::path(std::string_view)’: ../include/sdbusplus/bus/match.hpp:93:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::path(std::string_view)’ 93 | constexpr auto path(std::string_view s) noexcept | ^~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::path_namespace(std::string_view)’: ../include/sdbusplus/bus/match.hpp:97:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::path_namespace(std::string_view)’ 97 | constexpr auto path_namespace(std::string_view s) noexcept | ^~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::destination(std::string_view)’: ../include/sdbusplus/bus/match.hpp:101:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::destination(std::string_view)’ 101 | constexpr auto destination(std::string_view s) noexcept | ^~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::arg0namespace(std::string_view)’: ../include/sdbusplus/bus/match.hpp:116:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::arg0namespace(std::string_view)’ 116 | constexpr auto arg0namespace(std::string_view s) noexcept | ^~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::eavesdrop()’: ../include/sdbusplus/bus/match.hpp:120:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::eavesdrop()’ 120 | constexpr auto eavesdrop() noexcept | ^~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::nameOwnerChanged()’: ../include/sdbusplus/bus/match.hpp:125:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::nameOwnerChanged()’ 125 | constexpr auto nameOwnerChanged() noexcept | ^~~~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::interfacesAdded()’: ../include/sdbusplus/bus/match.hpp:130:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::interfacesAdded()’ 130 | constexpr auto interfacesAdded() noexcept | ^~~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::interfacesRemoved()’: ../include/sdbusplus/bus/match.hpp:135:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::interfacesRemoved()’ 135 | constexpr auto interfacesRemoved() noexcept | ^~~~~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::interfacesAdded(std::string_view)’: ../include/sdbusplus/bus/match.hpp:140:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::interfacesAdded(std::string_view)’ 140 | constexpr auto interfacesAdded(std::string_view p) noexcept | ^~~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::interfacesRemoved(std::string_view)’: ../include/sdbusplus/bus/match.hpp:145:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::interfacesRemoved(std::string_view)’ 145 | constexpr auto interfacesRemoved(std::string_view p) noexcept | ^~~~~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::propertiesChangedNamespace(std::string_view, std::string_view)’: ../include/sdbusplus/bus/match.hpp:159:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::propertiesChangedNamespace(std::string_view, std::string_view)’ 159 | constexpr auto propertiesChangedNamespace(std::string_view p, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ [33/89] Compiling C++ object example/asio-example.p/asio-example.cpp.o FAILED: example/asio-example.p/asio-example.cpp.o c++ -Iexample/asio-example.p -Iexample -I../example -I../include -I/usr/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c++20 -O2 -g -DBOOST_ASIO_DISABLE_THREADS -DBOOST_ALL_NO_LIB -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -MD -MQ example/asio-example.p/asio-example.cpp.o -MF example/asio-example.p/asio-example.cpp.o.d -o example/asio-example.p/asio-example.cpp.o -c ../example/asio-example.cpp In file included from ../include/sdbusplus/server.hpp:4, from ../include/sdbusplus/asio/object_server.hpp:13, from ../example/asio-example.cpp:4: ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::type::signal()’: ../include/sdbusplus/bus/match.hpp:62:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::type::signal()’ 62 | constexpr auto signal() noexcept | ^~~~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/stdexcept:39, from /usr/include/boost/asio/io_context.hpp:20, from ../example/asio-example.cpp:1: /usr/include/c++/11/bits/basic_string.h:85:11: note: ‘std::__cxx11::basic_string<char>’ is not literal because: 85 | class basic_string | ^~~~~~~~~~~~ /usr/include/c++/11/bits/basic_string.h:85:11: note: ‘std::__cxx11::basic_string<char>’ does not have ‘constexpr’ destructor In file included from ../include/sdbusplus/server.hpp:4, from ../include/sdbusplus/asio/object_server.hpp:13, from ../example/asio-example.cpp:4: ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::type::method()’: ../include/sdbusplus/bus/match.hpp:66:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::type::method()’ 66 | constexpr auto method() noexcept | ^~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::type::method_return()’: ../include/sdbusplus/bus/match.hpp:70:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::type::method_return()’ 70 | constexpr auto method_return() noexcept | ^~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::type::error()’: ../include/sdbusplus/bus/match.hpp:74:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::type::error()’ 74 | constexpr auto error() noexcept | ^~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::sender(std::string_view)’: ../include/sdbusplus/bus/match.hpp:81:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::sender(std::string_view)’ 81 | constexpr auto sender(std::string_view s) noexcept | ^~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::interface(std::string_view)’: ../include/sdbusplus/bus/match.hpp:85:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::interface(std::string_view)’ 85 | constexpr auto interface(std::string_view s) noexcept | ^~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::member(std::string_view)’: ../include/sdbusplus/bus/match.hpp:89:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::member(std::string_view)’ 89 | constexpr auto member(std::string_view s) noexcept | ^~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::path(std::string_view)’: ../include/sdbusplus/bus/match.hpp:93:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::path(std::string_view)’ 93 | constexpr auto path(std::string_view s) noexcept | ^~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::path_namespace(std::string_view)’: ../include/sdbusplus/bus/match.hpp:97:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::path_namespace(std::string_view)’ 97 | constexpr auto path_namespace(std::string_view s) noexcept | ^~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::destination(std::string_view)’: ../include/sdbusplus/bus/match.hpp:101:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::destination(std::string_view)’ 101 | constexpr auto destination(std::string_view s) noexcept | ^~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::arg0namespace(std::string_view)’: ../include/sdbusplus/bus/match.hpp:116:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::arg0namespace(std::string_view)’ 116 | constexpr auto arg0namespace(std::string_view s) noexcept | ^~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::eavesdrop()’: ../include/sdbusplus/bus/match.hpp:120:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::eavesdrop()’ 120 | constexpr auto eavesdrop() noexcept | ^~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::nameOwnerChanged()’: ../include/sdbusplus/bus/match.hpp:125:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::nameOwnerChanged()’ 125 | constexpr auto nameOwnerChanged() noexcept | ^~~~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::interfacesAdded()’: ../include/sdbusplus/bus/match.hpp:130:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::interfacesAdded()’ 130 | constexpr auto interfacesAdded() noexcept | ^~~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::interfacesRemoved()’: ../include/sdbusplus/bus/match.hpp:135:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::interfacesRemoved()’ 135 | constexpr auto interfacesRemoved() noexcept | ^~~~~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::interfacesAdded(std::string_view)’: ../include/sdbusplus/bus/match.hpp:140:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::interfacesAdded(std::string_view)’ 140 | constexpr auto interfacesAdded(std::string_view p) noexcept | ^~~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::interfacesRemoved(std::string_view)’: ../include/sdbusplus/bus/match.hpp:145:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::interfacesRemoved(std::string_view)’ 145 | constexpr auto interfacesRemoved(std::string_view p) noexcept | ^~~~~~~~~~~~~~~~~ ../include/sdbusplus/bus/match.hpp: In function ‘constexpr auto sdbusplus::bus::match::rules::propertiesChangedNamespace(std::string_view, std::string_view)’: ../include/sdbusplus/bus/match.hpp:159:16: error: invalid return type ‘std::__cxx11::basic_string<char>’ of ‘constexpr’ function ‘constexpr auto sdbusplus::bus::match::rules::propertiesChangedNamespace(std::string_view, std::string_view)’ 159 | constexpr auto propertiesChangedNamespace(std::string_view p, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../example/asio-example.cpp:4: ../include/sdbusplus/asio/object_server.hpp: In member function ‘bool sdbusplus::asio::dbus_interface::register_property_r(const string&, const PropertyType&, uint64_t, CallbackTypeGet&&)’: ../include/sdbusplus/asio/object_server.hpp:412:13: error: there are no arguments to ‘sd_bus_member_name_is_valid’ that depend on a template parameter, so a declaration of ‘sd_bus_member_name_is_valid’ must be available [-fpermissive] 412 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp:412:13: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) ../include/sdbusplus/asio/object_server.hpp: In member function ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const string&, const PropertyType&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&)’: ../include/sdbusplus/asio/object_server.hpp:455:13: error: there are no arguments to ‘sd_bus_member_name_is_valid’ that depend on a template parameter, so a declaration of ‘sd_bus_member_name_is_valid’ must be available [-fpermissive] 455 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In member function ‘bool sdbusplus::asio::dbus_interface::register_signal(const string&)’: ../include/sdbusplus/asio/object_server.hpp:575:13: error: there are no arguments to ‘sd_bus_member_name_is_valid’ that depend on a template parameter, so a declaration of ‘sd_bus_member_name_is_valid’ must be available [-fpermissive] 575 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In member function ‘bool sdbusplus::asio::dbus_interface::initialize(bool)’: ../include/sdbusplus/asio/object_server.hpp:752:38: error: ‘SD_BUS_VTABLE_ABSOLUTE_OFFSET’ was not declared in this scope 752 | element.flags_ | SD_BUS_VTABLE_ABSOLUTE_OFFSET)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp:759:38: error: ‘SD_BUS_VTABLE_ABSOLUTE_OFFSET’ was not declared in this scope 759 | element.flags_ | SD_BUS_VTABLE_ABSOLUTE_OFFSET)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp:770:34: error: ‘SD_BUS_VTABLE_ABSOLUTE_OFFSET’ was not declared in this scope 770 | element.flags_ | SD_BUS_VTABLE_ABSOLUTE_OFFSET)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_r(const string&, const PropertyType&, uint64_t, CallbackTypeGet&&) [with PropertyType = int; CallbackTypeGet = int (&)(const int&); std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:498:39: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const string&, const PropertyType&, sdbusplus::asio::PropertyPermission) [with PropertyType = int; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:207:29: required from here ../include/sdbusplus/asio/object_server.hpp:412:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 412 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const string&, const PropertyType&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = int; CallbackTypeSet = bool (&)(const int&, int&); CallbackTypeGet = int (&)(const int&); std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:504:40: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const string&, const PropertyType&, sdbusplus::asio::PropertyPermission) [with PropertyType = int; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:207:29: required from here ../include/sdbusplus/asio/object_server.hpp:455:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 455 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_r(const string&, const PropertyType&, uint64_t, CallbackTypeGet&&) [with PropertyType = std::vector<std::__cxx11::basic_string<char> >; CallbackTypeGet = std::vector<std::__cxx11::basic_string<char> > (&)(const std::vector<std::__cxx11::basic_string<char> >&); std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:498:39: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const string&, const PropertyType&, sdbusplus::asio::PropertyPermission) [with PropertyType = std::vector<std::__cxx11::basic_string<char> >; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:212:29: required from here ../include/sdbusplus/asio/object_server.hpp:412:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 412 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const string&, const PropertyType&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = std::vector<std::__cxx11::basic_string<char> >; CallbackTypeSet = bool (&)(const std::vector<std::__cxx11::basic_string<char> >&, std::vector<std::__cxx11::basic_string<char> >&); CallbackTypeGet = std::vector<std::__cxx11::basic_string<char> > (&)(const std::vector<std::__cxx11::basic_string<char> >&); std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:504:40: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const string&, const PropertyType&, sdbusplus::asio::PropertyPermission) [with PropertyType = std::vector<std::__cxx11::basic_string<char> >; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:212:29: required from here ../include/sdbusplus/asio/object_server.hpp:455:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 455 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const string&, const PropertyType&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = int; CallbackTypeSet = server()::<lambda(const int&, int&)>; CallbackTypeGet = int (&)(const int&); std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:517:36: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const string&, const PropertyType&, CallbackTypeSet&&) [with PropertyType = int; CallbackTypeSet = server()::<lambda(const int&, int&)>; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:217:29: required from here ../include/sdbusplus/asio/object_server.hpp:455:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const string&, const PropertyType&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackTypeSet = server()::<lambda(const string&, std::string&)>; CallbackTypeGet = server()::<lambda(const string&)>; std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:532:36: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const string&, const PropertyType&, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackTypeSet = server()::<lambda(const string&, std::string&)>; CallbackTypeGet = server()::<lambda(const string&)>; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:227:29: required from here ../include/sdbusplus/asio/object_server.hpp:455:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope In file included from /usr/include/c++/11/functional:59, from /usr/include/boost/asio/detail/functional.hpp:20, from /usr/include/boost/asio/associated_allocator.hpp:21, from /usr/include/boost/asio/detail/handler_alloc_helpers.hpp:23, from /usr/include/boost/asio/detail/bind_handler.hpp:20, from /usr/include/boost/asio/detail/wrapped_handler.hpp:18, from /usr/include/boost/asio/io_context.hpp:25, from ../example/asio-example.cpp:1: /usr/include/c++/11/bits/std_function.h: At global scope: /usr/include/c++/11/bits/std_function.h:435:9: error: ‘std::function<_Res(_ArgTypes ...)>::function(_Functor&&) [with _Functor = server()::<lambda(const int&, int&)>; _Constraints = void; _Res = bool; _ArgTypes = {const int&, int&}]’, declared using local type ‘server()::<lambda(const int&, int&)>’, is used but never defined [-fpermissive] 435 | function(_Functor&& __f) | ^~~~~~~~ In file included from ../example/asio-example.cpp:4: ../include/sdbusplus/asio/object_server.hpp:296:5: error: ‘sdbusplus::asio::callback_get_instance<PropertyType, CallbackType>::callback_get_instance(const std::shared_ptr<_Tp>&, CallbackType&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackType = server()::<lambda(const string&)>]’, declared using local type ‘server()::<lambda(const string&)>’, is used but never defined [-fpermissive] 296 | callback_get_instance(const std::shared_ptr<PropertyType>& value, | ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/functional:59, from /usr/include/boost/asio/detail/functional.hpp:20, from /usr/include/boost/asio/associated_allocator.hpp:21, from /usr/include/boost/asio/detail/handler_alloc_helpers.hpp:23, from /usr/include/boost/asio/detail/bind_handler.hpp:20, from /usr/include/boost/asio/detail/wrapped_handler.hpp:18, from /usr/include/boost/asio/io_context.hpp:25, from ../example/asio-example.cpp:1: /usr/include/c++/11/bits/std_function.h:435:9: error: ‘std::function<_Res(_ArgTypes ...)>::function(_Functor&&) [with _Functor = server()::<lambda(const string&, std::string&)>; _Constraints = void; _Res = bool; _ArgTypes = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&}]’, declared using local type ‘server()::<lambda(const string&, std::string&)>’, is used but never defined [-fpermissive] 435 | function(_Functor&& __f) | ^~~~~~~~ [41/89] Compiling C++ object test/test-message_read.p/message_read.cpp.o ninja: build stopped: subcommand failed.

@williamspatrick
Copy link
Member

There are likely two issues you're running into:

  • Generally we require GCC-13. There are a number of C++20 support items that were incomplete in earlier versions of GCC. I recall that there is missing support for constexpr strings.

  • It looks like your libsystemd is pretty old because there are a number of missing constants and functions that are missing. Is it possible to update that?

@luacy200820
Copy link
Author

I already changed my g++ version to 13, and libsystemd version is 245.4-4ubuntu3.22.
I rebuilt still had the same error:

[3/89] Compiling C++ object libsdbusplus.so.1.0.0.p/src_event.cpp.o FAILED: libsdbusplus.so.1.0.0.p/src_event.cpp.o c++ -Ilibsdbusplus.so.1.0.0.p -I. -I.. -I../include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c++20 -O2 -g -fPIC -MD -MQ libsdbusplus.so.1.0.0.p/src_event.cpp.o -MF libsdbusplus.so.1.0.0.p/src_event.cpp.o.d -o libsdbusplus.so.1.0.0.p/src_event.cpp.o -c ../src/event.cpp ../src/event.cpp: In member function ‘sdbusplus::event::source sdbusplus::event::event::add_oneshot_timer(sd_event_time_handler_t, void*, time_resolution, time_resolution)’: ../src/event.cpp:156:15: error: ‘sd_event_add_time_relative’ was not declared in this scope; did you mean ‘sd_event_add_time’? 156 | auto rc = sd_event_add_time_relative(eventp, &s.sourcep, CLOCK_BOOTTIME, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | sd_event_add_time [15/89] Compiling C++ object test/test-event_event.p/event_event.cpp.o FAILED: test/test-event_event.p/event_event.cpp.o c++ -Itest/test-event_event.p -Itest -I../test -I../subprojects/googletest/googletest/include -I../subprojects/googletest/googletest -Isubprojects/googletest/__CMake_build -I../subprojects/googletest/__CMake_build -Isubprojects/googletest -I../subprojects/googletest -I../subprojects/googletest/googlemock/include -I../subprojects/googletest/googlemock -I../include -I/usr/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c++20 -O2 -g -DBOOST_ASIO_DISABLE_THREADS -DBOOST_ALL_NO_LIB -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -pthread -isystem../subprojects/googletest/googletest -isystem../subprojects/googletest/googletest/include -MD -MQ test/test-event_event.p/event_event.cpp.o -MF test/test-event_event.p/event_event.cpp.o.d -o test/test-event_event.p/event_event.cpp.o -c ../test/event/event.cpp In file included from ../test/event/event.cpp:1: ../include/sdbusplus/event.hpp: In destructor ‘sdbusplus::event::condition::~condition()’: ../include/sdbusplus/event.hpp:62:13: error: ‘close’ was not declared in this scope; did you mean ‘pclose’? 62 | close(fd); | ^~~~~ | pclose [28/89] Compiling C++ object test/test-bus_aio.p/bus_aio.cpp.o ../include/sdbusplus/asio/object_server.hpp: In member function ‘bool sdbusplus::asio::dbus_interface::initialize(bool)’: ../include/sdbusplus/asio/object_server.hpp:752:38: error: ‘SD_BUS_VTABLE_ABSOLUTE_OFFSET’ was not declared in this scope 752 | element.flags_ | SD_BUS_VTABLE_ABSOLUTE_OFFSET)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp:759:38: error: ‘SD_BUS_VTABLE_ABSOLUTE_OFFSET’ was not declared in this scope 759 | element.flags_ | SD_BUS_VTABLE_ABSOLUTE_OFFSET)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp:770:34: error: ‘SD_BUS_VTABLE_ABSOLUTE_OFFSET’ was not declared in this scope 770 | element.flags_ | SD_BUS_VTABLE_ABSOLUTE_OFFSET)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_r(const std::string&, const PropertyType&, uint64_t, CallbackTypeGet&&) [with PropertyType = int; CallbackTypeGet = int (&)(const int&); std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:498:39: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const std::string&, const PropertyType&, sdbusplus::asio::PropertyPermission) [with PropertyType = int; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:207:29: required from here ../include/sdbusplus/asio/object_server.hpp:412:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 412 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const std::string&, const PropertyType&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = int; CallbackTypeSet = bool (&)(const int&, int&); CallbackTypeGet = int (&)(const int&); std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:504:40: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const std::string&, const PropertyType&, sdbusplus::asio::PropertyPermission) [with PropertyType = int; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:207:29: required from here ../include/sdbusplus/asio/object_server.hpp:455:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 455 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_r(const std::string&, const PropertyType&, uint64_t, CallbackTypeGet&&) [with PropertyType = std::vector<std::__cxx11::basic_string<char> >; CallbackTypeGet = std::vector<std::__cxx11::basic_string<char> > (&)(const std::vector<std::__cxx11::basic_string<char> >&); std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:498:39: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const std::string&, const PropertyType&, sdbusplus::asio::PropertyPermission) [with PropertyType = std::vector<std::__cxx11::basic_string<char> >; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:212:29: required from here ../include/sdbusplus/asio/object_server.hpp:412:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 412 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const std::string&, const PropertyType&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = std::vector<std::__cxx11::basic_string<char> >; CallbackTypeSet = bool (&)(const std::vector<std::__cxx11::basic_string<char> >&, std::vector<std::__cxx11::basic_string<char> >&); CallbackTypeGet = std::vector<std::__cxx11::basic_string<char> > (&)(const std::vector<std::__cxx11::basic_string<char> >&); std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:504:40: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const std::string&, const PropertyType&, sdbusplus::asio::PropertyPermission) [with PropertyType = std::vector<std::__cxx11::basic_string<char> >; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:212:29: required from here ../include/sdbusplus/asio/object_server.hpp:455:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope 455 | if (sd_bus_member_name_is_valid(name.c_str()) != 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const std::string&, const PropertyType&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = int; CallbackTypeSet = server()::<lambda(const int&, int&)>; CallbackTypeGet = int (&)(const int&); std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:517:36: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const std::string&, const PropertyType&, CallbackTypeSet&&) [with PropertyType = int; CallbackTypeSet = server()::<lambda(const int&, int&)>; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:217:29: required from here ../include/sdbusplus/asio/object_server.hpp:455:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope ../include/sdbusplus/asio/object_server.hpp: In instantiation of ‘bool sdbusplus::asio::dbus_interface::register_property_rw(const std::string&, const PropertyType&, uint64_t, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackTypeSet = server()::<lambda(const std::string&, std::string&)>; CallbackTypeGet = server()::<lambda(const std::string&)>; std::string = std::__cxx11::basic_string<char>; uint64_t = long unsigned int]’: ../include/sdbusplus/asio/object_server.hpp:532:36: required from ‘bool sdbusplus::asio::dbus_interface::register_property(const std::string&, const PropertyType&, CallbackTypeSet&&, CallbackTypeGet&&) [with PropertyType = std::__cxx11::basic_string<char>; CallbackTypeSet = server()::<lambda(const std::string&, std::string&)>; CallbackTypeGet = server()::<lambda(const std::string&)>; std::string = std::__cxx11::basic_string<char>]’ ../example/asio-example.cpp:227:29: required from here ../include/sdbusplus/asio/object_server.hpp:455:40: error: ‘sd_bus_member_name_is_valid’ was not declared in this scope [41/89] Compiling C++ object test/test-message_read.p/message_read.cpp.o ninja: build stopped: subcommand failed.

@williamspatrick
Copy link
Member

libsystemd will need to be more recent than that. We typically either build in a Docker container with much more recent versions of the dependencies or we build under Yocto, where the dependencies are also very recent.

What is it you're trying to accomplish?

@luacy200820
Copy link
Author

I want to run asio_example.cpp on my Ubuntu. I will be building new recipes in some meta-layer of openbmc, so I need to include the sdbusplus library.
In my Ubuntu, when I use find_package in the makefile, the sdbusplus archive is not found. Do you have any good suggestions? Or I need to write other related files.

@adrien-zinger
Copy link

Hi @luacy200820, I'm trying to build the project on a centos too. I had the same issues. The most recent tag needed I found for systemd is v246-rc1~288^2~5, I can't say if you'll need a more recent version.

It could be great to have the details of the minimal requirements for gcc, systemd, etc on the repo.

@adrien-zinger
Copy link

I succeed to build on a centos (8 stream) with those versions:

  • systemd 253
  • gcc 13.1.1
  • meson 1.2.3
  • ninja 1.11.1
  • python 3.9

But I had to use this patch:

diff --git a/include/sdbusplus/event.hpp b/include/sdbusplus/event.hpp
index 951db43..288ab19 100644
--- a/include/sdbusplus/event.hpp
+++ b/include/sdbusplus/event.hpp
@@ -5,6 +5,7 @@
 #include <chrono>
 #include <mutex>
 #include <utility>
+#include <unistd.h>

 namespace sdbusplus
 {
diff --git a/meson.build b/meson.build
index 52e330a..9e1ece1 100644
--- a/meson.build
+++ b/meson.build
@@ -12,6 +12,7 @@ project('sdbusplus', 'cpp', 'c',
 )

 libsystemd_pkg = dependency('libsystemd')
+thread_dep = dependency('threads')

 python = import('python')
 python_bin = python.find_installation('python3', modules:['inflection', 'yaml', 'mako'])
@@ -40,7 +41,7 @@ libsdbusplus = library(
     'sdbusplus',
     libsdbusplus_src,
     include_directories: root_inc,
-    dependencies: libsystemd_pkg,
+    dependencies: [ libsystemd_pkg, thread_dep ],
     version: meson.project_version(),
     install: true,
 )

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

3 participants