Skip to content

Conversation

@traversaro
Copy link
Contributor

Fix #6 .

There are three kind of fixes, listed in the following. If useful, I can split them in separate commits and/or PRs:

  • Only add GCC/Clang specific options on GCC/Clang
  • For the packages that build shared libraries, define CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to ensure that the libraries export all their symbols, as done in Linux and macOS.
  • Fix installation of shared libraries: in Windows the shared libraries are composed by two parts, the .lib import library used in linking (that are installed in $CMAKE_INSTALL_PREFIX/lib), and the .dll library used in loading ($CMAKE_INSTALL_PREFIX/bin). The current cmake code installs both of them in $CMAKE_INSTALL_PREFIX/lib, creating runtime problems (see Apriltag detector does not work on Windows as it installs dll in wrong path RoboStack/ros-jazzy#70). Since CMake 3.16 (the minimum version supported here) the easiest solution to install libraries in the correct locations is just to remove the DESTINATION argument from install(TARGETS, as the default locations are the correct ones: https://cmake.org/cmake/help/v3.16/command/install.html#installing-files .

@traversaro traversaro changed the title Fix compilation and running on Windows Fix compilation and loading of shared libraries on Windows Jun 14, 2025
@berndpfrommer
Copy link
Collaborator

Thank you for the PR!
Some of the tests fail before the build even starts. Will have to look into it.

@berndpfrommer
Copy link
Collaborator

Can't get the last checks to re-run. Closing the PR, then re-opening it.

@berndpfrommer berndpfrommer merged commit a2621c4 into ros-misc-utilities:master Jun 16, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

Compile errors in windows

2 participants