ros-industrial / ros2_canopen

CANopen driver framework for ROS2
https://ros-industrial.github.io/ros2_canopen/manual/rolling/
159 stars 70 forks source link

Can't compile custom driver with clang, runtime error #325

Open Ewoodss opened 1 month ago

Ewoodss commented 1 month ago

Bug description When creating a custom driver, and trying too compile with clang++ the following error happens.

To Reproduce Compile a driver component with clang++ CC=clang CXX=clang++ colcon build

Expected behavior The compilation should be succes full

Logs /opt/ros/humble/include/canopen_core/node_interfaces/node_canopen_driver.hpp:198:43: error: use 'template' keyword to treat 'as' as a dependent template name auto path = this->config_["dcf_path"].as<std::string>(); /opt/ros/humble/include/canopen_core/node_interfaces/node_canopen_driver.hpp:199:37: error: use 'template' keyword to treat 'as' as a dependent template name auto dcf = this->config_["dcf"].as<std::string>();

Setup:

Additional context Compiling the humble branch itself with clang/clang++ also seems to be broken, but this isn't a issue when getting it using rosdep. and only creating a custom driver.

Ewoodss commented 1 month ago

So there also seems to be a issue with linking too the dynamic symbol for is_canopen_basic.

it shoud link too std::enable_if<lely::canopen::is_canopen_basic<signed char, signed char>::value, void>::type lely::canopen::Device::TpdoWrite<signed char>(unsigned char, unsigned short, unsigned char, signed char) std::enable_if<lely::canopen::is_canopen_basic<int, int>::value, void>::type lely::canopen::Device::TpdoWrite<int>(unsigned char, unsigned short, unsigned char, int) std::enable_if<lely::canopen::is_canopen_basic<unsigned short, unsigned short>::value, void>::type lely::canopen::Device::TpdoWrite<unsigned short>(unsigned char, unsigned short, unsigned char, unsigned short)

but links too std::enable_if<is_canopen_basic<signed char, signed char>::value, void>::type lely::canopen::Device::TpdoWrite<signed char>(unsigned char, unsigned short, unsigned char, signed char) std::enable_if<is_canopen_basic<int, int>::value, void>::type lely::canopen::Device::TpdoWrite<int>(unsigned char, unsigned short, unsigned char, int) std::enable_if<is_canopen_basic<unsigned short, unsigned short>::value, void>::type lely::canopen::Device::TpdoWrite<unsigned short>(unsigned char, unsigned short, unsigned char, unsigned short)