Fix macOS linker flag and link OpenCV in CMakeLists,txt#523
Merged
Conversation
Samahu
approved these changes
Mar 12, 2026
025bd12
into
ouster-lidar:restore-whole-archive-and-update-use-modern-way-to-add-definitions
Samahu
added a commit
that referenced
this pull request
Mar 12, 2026
* Restore whole-archive and use modern add compile definitions * More build refinements * Make sure the code is portable * Fix macOS linker flag and link OpenCV into ouster_ros_nodelets (#523) * Put back catkin_LIBRARIES for the nodelets --------- Co-authored-by: alexc-ouster <alex.chua@ouster.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues & PRs
#521
Summary of Changes
This PR fixes two build issues on macOS:
The linker was invoked with the wrong flag
-force-load(hyphen) which ld on macOS rejects. It is now-force_load(underscore) in the Apple branch of CMakeLists.txt.The nodelets target was not explicitly linked against OpenCV, causing undefined cv:: symbols when building libouster_ros_nodelets.dylib.
${OpenCV_LIBS}is now added to the nodelets target.Files changed:
CMakeLists.txtValidation
catkin_make --cmake-args -DCMAKE_BUILD_TYPE=Release:catkin_make --cmake-args -DCMAKE_BUILD_TYPE=Release:Result after fixing:
Compile in Ubuntu OS
Test result:
roslaunch ouster_ros sensor.launch sensor_hostname:=<hostname>in MacOS
In Ubuntu