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

Errors when building with Clang #1931

Open
mishmetall opened this issue Feb 3, 2024 · 5 comments
Open

Errors when building with Clang #1931

mishmetall opened this issue Feb 3, 2024 · 5 comments

Comments

@mishmetall
Copy link

When building with Clang, I'm getting these errors:

> colcon build --cmake-args -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++

...
In file included from /home/rosdev/ros2_ws/src/mavros/mavros/src/lib/mavros_router.cpp:20:
/home/rosdev/ros2_ws/src/mavros/mavros/include/mavros/mavros_router.hpp:72:32: error: allocating an object of abstract class type 'mavros::router::Endpoint'
  RCLCPP_SMART_PTR_DEFINITIONS(Endpoint)
                               ^
/home/rosdev/ros2_ws/src/mavros/mavros/include/mavros/mavros_router.hpp:103:16: note: unimplemented pure virtual method 'is_open' in 'Endpoint'
  virtual bool is_open() = 0;
               ^
/home/rosdev/ros2_ws/src/mavros/mavros/include/mavros/mavros_router.hpp:104:40: note: unimplemented pure virtual method 'open' in 'Endpoint'
  virtual std::pair<bool, std::string> open() = 0;
                                       ^
/home/rosdev/ros2_ws/src/mavros/mavros/include/mavros/mavros_router.hpp:105:16: note: unimplemented pure virtual method 'close' in 'Endpoint'
  virtual void close() = 0;
               ^
/home/rosdev/ros2_ws/src/mavros/mavros/include/mavros/mavros_router.hpp:107:16: note: unimplemented pure virtual method 'send_message' in 'Endpoint'
  virtual void send_message(
               ^
/home/rosdev/ros2_ws/src/mavros/mavros/include/mavros/mavros_router.hpp:113:16: note: unimplemented pure virtual method 'diag_run' in 'Endpoint'
  virtual void diag_run(diagnostic_updater::DiagnosticStatusWrapper & stat) = 0;
               ^
In file included from /home/rosdev/ros2_ws/src/mavros/mavros/src/lib/uas_data.cpp:19:
In file included from /home/rosdev/ros2_ws/src/mavros/mavros/include/mavros/mavros_uas.hpp:45:
/home/rosdev/ros2_ws/src/mavros/mavros/include/mavros/plugin.hpp:68:32: error: allocating an object of abstract class type 'mavros::plugin::Plugin'
  RCLCPP_SMART_PTR_DEFINITIONS(Plugin)
                               ^
/home/rosdev/ros2_ws/src/mavros/mavros/include/mavros/plugin.hpp:95:25: note: unimplemented pure virtual method 'get_subscriptions' in 'Plugin'
  virtual Subscriptions get_subscriptions() = 0;

MAVROS version and platform

Mavros: 2e20c1c
ROS: Humble, Foxy
Ubuntu: 22.04, 20.04

@vooon
Copy link
Member

vooon commented Feb 5, 2024

Clang, what for? Never tried to build rclcpp with it.

@mishmetall
Copy link
Author

Clang has various features for analysis, e.g. Quality guide: ensuring code quality, but it's also a good thing to not depend on a single WoW, gcc and clang are the most widely used compilers

@vooon
Copy link
Member

vooon commented Feb 5, 2024

So, does rclcpp and other components compile fine? I'm not quite interested in jumping and changing rcl's macros across whole codebase of mavros.

@mishmetall
Copy link
Author

Not sure about rclcpp, never tried, but other components that I tried to compile just fine. I guess Mavros will compile just fine as well if this problem is fixed, I have seen only this issue so far

@mishmetall
Copy link
Author

mishmetall commented Feb 5, 2024

It's mentioned in the documentation that it is possible to do Ros2 Building with clang

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

No branches or pull requests

2 participants