Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

compile error in sdbusplus source #14

Open
lbbxsxlz opened this issue Sep 27, 2022 · 2 comments
Open

compile error in sdbusplus source #14

lbbxsxlz opened this issue Sep 27, 2022 · 2 comments

Comments

@lbbxsxlz
Copy link

when I use "cmake -DBUILD_STANDALONE=ON -DMCTPD_BUILD_UT=ON ../" to build the repo, I find some compile errors in sdbusplus project.

Gcc infomation:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu120.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1
20.04.1)

error information:
Making install in example
CXX calculator_server-calculator-server.o
calculator-server.cpp:9:61: error: ‘server’ is not a member of ‘sdbusplus::net::poettering’; did you mean ‘sdbusplus::server’?
9 | sdbusplus::server::object_tsdbusplus::net::poettering::server::Calculator;
| ^~~~~~
In file included from ../sdbusplus/server.hpp:3,
from calculator-server.cpp:5:
../sdbusplus/bus.hpp:20:11: note: ‘sdbusplus::server’ declared here
20 | namespace server
| ^~~~~~
calculator-server.cpp:9:79: error: template argument 1 is invalid
9 | sdbusplus::server::object_tsdbusplus::net::poettering::server::Calculator;
| ^
calculator-server.cpp:13:1: error: expected class-name before ‘{’ token
13 | {
| ^
calculator-server.cpp:21:13: error: ‘int64_t Calculator::multiply(int64_t, int64_t)’ marked ‘override’, but does not override
21 | int64_t multiply(int64_t x, int64_t y) override
| ^~~~~~~~
calculator-server.cpp:30:13: error: ‘int64_t Calculator::divide(int64_t, int64_t)’ marked ‘override’, but does not override
30 | int64_t divide(int64_t x, int64_t y) override
| ^~~~~~
calculator-server.cpp:43:10: error: ‘void Calculator::clear()’ marked ‘override’, but does not override
43 | void clear() override
| ^~~~~
calculator-server.cpp: In constructor ‘Calculator::Calculator(sdbusplus::bus::bus&, const char*)’:
calculator-server.cpp:16:9: error: class ‘Calculator’ does not have any field named ‘Calculator_inherit’
16 | Calculator_inherit(bus, path)
| ^~~~~~~~~~~~~~~~~~
calculator-server.cpp: In member function ‘int64_t Calculator::multiply(int64_t, int64_t)’:
calculator-server.cpp:23:16: error: ‘lastResult’ was not declared in this scope
23 | return lastResult(x * y);
| ^~~~~~~~~~
calculator-server.cpp: In member function ‘int64_t Calculator::divide(int64_t, int64_t)’:
calculator-server.cpp:35:20: error: ‘State’ has not been declared
35 | status(State::Error);
| ^~~~~
calculator-server.cpp:35:13: error: ‘status’ was not declared in this scope; did you mean ‘static’?
35 | status(State::Error);
| ^~~~~~
| static
calculator-server.cpp:39:16: error: ‘lastResult’ was not declared in this scope
39 | return lastResult(x / y);
| ^~~~~~~~~~
calculator-server.cpp: In member function ‘void Calculator::clear()’:
calculator-server.cpp:45:18: error: ‘lastResult’ was not declared in this scope
45 | auto v = lastResult();
| ^~~~~~~~~~
calculator-server.cpp:47:9: error: ‘cleared’ was not declared in this scope; did you mean ‘clear’?
47 | cleared(v);
| ^~~~~~~
| clear
calculator-server.cpp: In function ‘int main()’:
calculator-server.cpp:60:38: error: ‘interface’ is not a member of ‘Calculator’
60 | std::string_view(Calculator::interface));
| ^~~~~~~~~
make[5]: *** [Makefile:580: calculator_server-calculator-server.o] Error 1
make[4]: *** [Makefile:737: install] Error 2
make[3]: *** [Makefile:819: install-recursive] Error 1
make[2]: *** [CMakeFiles/sdbusplus-project.dir/build.make:103: sdbusplus-project-prefix/src/sdbusplus-project-stamp/sdbusplus-project-install] Error 2
make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/sdbusplus-project.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
CMake Error at CMakeLists.txt:159 (find_package):
Could not find a package configuration file provided by "GTest" with any of
the following names:

GTestConfig.cmake
gtest-config.cmake

Add the installation prefix of "GTest" to CMAKE_PREFIX_PATH or set
"GTest_DIR" to a directory containing one of the above files. If "GTest"
provides a separate development package or SDK, be sure it has been
installed.

-- Configuring incomplete, errors occurred!

@Kendidi
Copy link

Kendidi commented Dec 5, 2023

@lbbxsxlz I ran into the same issue. Were you able to resolve the compile issue? Thanks.

@Kendidi
Copy link

Kendidi commented Dec 5, 2023

I installed GTest and GMock and now:

gmake[2]: *** [CMakeFiles/Boost.dir/build.make:86: Boost-prefix/src/Boost-stamp/Boost-build] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:97: CMakeFiles/Boost.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
-- Configuring done
CMake Error at CMakeLists.txt:155 (add_executable):
  Target "test-mctpd" links to target "GTest::gmock" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants