-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
error C2491 "definition of dllimport function not allowed" on downstream package on Windows when compiled with BUILD_SHARED_LIBS set to OFF #1
Comments
Hmm, strange. I didn't see this kind of issue when building any of the native message packages... Could there be some boilerplate CMake missing? |
I think this is unrelated, the problem happens even if you comment out that part. To investigate the problem, I compared ros-galactic vs ros-humble, comparing the exact invocation of the compilation of the failing compilation unit:
The main difference is that in the galactic version |
Manually changing the related code to the Galactic version makes the library work, so I think that indeed it is a regression due to ros2/rosidl_typesupport_fastrtps#87 . |
Ok, I understood the problem, and it will probably take a bit of time for describing it and opening appropriate issue in the related repositories. However, the good news is that it occurs only if you compile a repo with |
Ah.. shouldn't we always build shared libs in our case? |
Yes, the problem is that the downstream repo (i.e. https://github.com/robotology-playground/yarp-ros2) was hardcoding |
I think we can close this now that an upstream issue was created: ros2/rosidl_typesupport_fastrtps#90 |
Sure, thanks for closing. I forgot close it myself after opening the issue upstream. |
I tried to migrate of a simple ROS2 package from RoboStack's Galactic (where it was working) to Humble (where the Windows build is not working).
The PR is robotology/yarp-devices-ros2#31 and the code is https://github.com/robotology-playground/yarp-ros2/blob/4ae984d11428491ea0b7c61162707cf49836897a/ros2_interfaces_ws/src/map2d_nws_ros2_msgs/CMakeLists.txt, on Humble macOS and Linux are working but windows is failing with:
The text was updated successfully, but these errors were encountered: