You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the CI.yml GitHub of the repo https://github.com/traversaro/test_static_lib_ros2_srv. In particular, this repo generate the library for a .srv file, and the important thing is that the CMake project is compiled with BUILD_SHARED_LIBS set to OFF .
Expected behavior
I would expect the compilation to end successfully, as it was happening in Galactic.
However, this is not the fully story. The use of DEFINE_SYMBOL is actually correct in this context. The reason why everything is now failing is that the visibility header generated by this repo does not cover the case of a static libraries, for which the ROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_@PROJECT_NAME@ macro should evaluate to an empty string. Everything was working fine just because apparently in this case static libraries do not have problems if functions inside them are defined as __attribute__ ((dllexport)). The most complete fix would be to consider the static case in the visibility header macro (as done for example in the example at the end of https://gcc.gnu.org/wiki/Visibility), and pass to the library some kind of macro to indicate if the library is static or shared.
The text was updated successfully, but these errors were encountered:
Bug report
Required Info:
Steps to reproduce issue
See the
CI.yml
GitHub of the repo https://github.com/traversaro/test_static_lib_ros2_srv. In particular, this repo generate the library for a.srv
file, and the important thing is that the CMake project is compiled withBUILD_SHARED_LIBS
set toOFF
.Expected behavior
I would expect the compilation to end successfully, as it was happening in Galactic.
Actual behavior
The compilation fails with error:
Additional information
I think this is a regression of #87, where:
has been substituted with
However, this is not the fully story. The use of
DEFINE_SYMBOL
is actually correct in this context. The reason why everything is now failing is that the visibility header generated by this repo does not cover the case of a static libraries, for which theROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_@PROJECT_NAME@
macro should evaluate to an empty string. Everything was working fine just because apparently in this case static libraries do not have problems if functions inside them are defined as__attribute__ ((dllexport))
. The most complete fix would be to consider the static case in the visibility header macro (as done for example in the example at the end of https://gcc.gnu.org/wiki/Visibility), and pass to the library some kind of macro to indicate if the library is static or shared.The text was updated successfully, but these errors were encountered: