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

Compile problem with macOS 14.4.1: error: only virtual member functions can be marked 'override' const std::string& message) override; #961

Open
RENyunfan opened this issue Apr 8, 2024 · 5 comments

Comments

@RENyunfan
Copy link

Problem description

Following #947, I still cannot compile plotjuggler on Mac with macOS 14.4.1 and Apple M3 chip. Need help.

image
[ 92%] Built target ProtobufParser_autogen
[ 93%] Building CXX object plotjuggler_plugins/ParserProtobuf/CMakeFiles/ProtobufParser.dir/ProtobufParser_autogen/mocs_compilation.cpp.o
In file included from /Users/renyunfan/Documents/plotjuggler_ws/build/PlotJuggler/plotjuggler_plugins/ParserProtobuf/ProtobufParser_autogen/mocs_compilation.cpp:2:
In file included from /Users/renyunfan/Documents/plotjuggler_ws/build/PlotJuggler/plotjuggler_plugins/ParserProtobuf/ProtobufParser_autogen/EWIEGA46WW/moc_protobuf_factory.cpp:10:
In file included from /Users/renyunfan/Documents/plotjuggler_ws/build/PlotJuggler/plotjuggler_plugins/ParserProtobuf/ProtobufParser_autogen/EWIEGA46WW/../../../../../../src/PlotJuggler/plotjuggler_plugins/ParserProtobuf/protobuf_factory.h:6:
In file included from /Users/renyunfan/Documents/plotjuggler_ws/src/PlotJuggler/plotjuggler_plugins/ParserProtobuf/protobuf_parser.h:12:
/Users/renyunfan/Documents/plotjuggler_ws/src/PlotJuggler/plotjuggler_plugins/ParserProtobuf/error_collectors.h:13:45: error: only virtual member functions can be marked 'override'
                const std::string& message) override;
                                            ^~~~~~~~
/Users/renyunfan/Documents/plotjuggler_ws/src/PlotJuggler/plotjuggler_plugins/ParserProtobuf/error_collectors.h:16:47: error: only virtual member functions can be marked 'override'
                  const std::string& message) override;
                                              ^~~~~~~~
/Users/renyunfan/Documents/plotjuggler_ws/src/PlotJuggler/plotjuggler_plugins/ParserProtobuf/error_collectors.h:31:45: error: only virtual member functions can be marked 'override'
                const std::string& message) override;
                                            ^~~~~~~~
/Users/renyunfan/Documents/plotjuggler_ws/src/PlotJuggler/plotjuggler_plugins/ParserProtobuf/error_collectors.h:34:47: error: only virtual member functions can be marked 'override'
                  const std::string& message) override;
                                              ^~~~~~~~
4 errors generated.
make[2]: *** [plotjuggler_plugins/ParserProtobuf/CMakeFiles/ProtobufParser.dir/ProtobufParser_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [plotjuggler_plugins/ParserProtobuf/CMakeFiles/ProtobufParser.dir/all] Error 2
make: *** [all] Error 2
@tonygon
Copy link

tonygon commented Apr 22, 2024

Same here.
I could only get all the way to this point with the comments from #947, following the discussion here
https://github.com/facontidavide/PlotJuggler/pull/950/files

When are those changes going to be merged?

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,18 @@ if(VCPKG_TOOLCHAIN)
     message(STATUS "BUILDING_WITH_VCPKG")
 endif()

+# Include PkgConfig module
+find_package(PkgConfig REQUIRED)
+
+# Use pkg_check_modules to find ZeroMQ
+pkg_check_modules(ZEROMQ REQUIRED IMPORTED_TARGET libzmq)
+
+# Include ZeroMQ directories
+include_directories(${ZEROMQ_INCLUDE_DIRS})
+# -------
+
 find_package(ament_cmake QUIET)
 find_package(catkin QUIET)

Thanks!

@syundo0730
Copy link

syundo0730 commented May 4, 2024

I could build it using an older version of protobuf.

brew install protobuf@21
brew link protobuf@21 --overwrite

@TalGlantz
Copy link

TalGlantz commented May 21, 2024

Still having issues compiling.
I modified the files based on: https://github.com/facontidavide/PlotJuggler/pull/950/files updates.

Tried to compile and got same error. What am I missing?

image

@lgkimjy
Copy link

lgkimjy commented Jun 13, 2024

@TalGlantz, I have the same issue. Could you let me know if you solved this compile error?

@glebv
Copy link

glebv commented Jun 15, 2024

I had the same issue, I used recipe from here #961 (comment) but I had to add path to protobuf and mosquitto. It's not a fully correct solution but it solved my issue

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 16477dd3..a240e057 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,16 @@ if(VCPKG_TOOLCHAIN)
     message(STATUS "BUILDING_WITH_VCPKG")
 endif()

+
+# Include PkgConfig module
+find_package(PkgConfig REQUIRED)
+
+# Use pkg_check_modules to find ZeroMQ
+pkg_check_modules(ZEROMQ REQUIRED IMPORTED_TARGET libzmq)
+
+# Include ZeroMQ directories
+include_directories(${ZEROMQ_INCLUDE_DIRS})
+
 find_package(ament_cmake QUIET)
 find_package(catkin QUIET)

@@ -103,6 +113,8 @@ if(APPLE AND EXISTS /usr/local/opt/qt5)
     set(CMAKE_MACOSX_RPATH 1)
 elseif(APPLE AND EXISTS /opt/homebrew/opt/qt@5)
     list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/qt@5")
+    list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/protobuf@21")
+    list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/mosquitto")
     set(CMAKE_MACOSX_RPATH 1)
 endif()

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

6 participants