ros-drivers / ros2_ouster_drivers

ROS2 Drivers for the Ouster OS-0, OS-1, and OS-2 Lidars
https://ouster.com/
Apache License 2.0
134 stars 79 forks source link

Fixed compile issue with newer version of jsoncpp #144

Closed splatter96 closed 3 months ago

splatter96 commented 3 months ago

This PR fixes the compile issue for newer version of jsoncpp available in the current version of Ubuntu 22.04.

splatter96 commented 3 months ago

@SteveMacenski could you take a look at this? :)

SteveMacenski commented 3 months ago

jsoncpp available in the current version of Ubuntu 22.04

This is where you lose me a bit, it should still work in 22.04. Is this really for 24.04 for Rolling/Jazzy and that's a typo?

splatter96 commented 3 months ago

I just verified with our second robot running Ubuntu 22.04 and all up to date package as of writing of this post, including libjsoncpp-dev 1.9.5-3 and libjsoncpp25 1.9.5-3. And the compile time issue occurs both for the ros2 and for the humble branch of this repo.

The error message reads:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/jsoncpp/jsoncpp-namespaced-targets.cmake:5 (add_library):
  add_library cannot create imported target "JsonCpp::JsonCpp" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/jsoncpp/jsoncppConfig.cmake:41 (include)
  CMakeLists.txt:24 (find_package)
splatter96 commented 3 months ago

I just checked with an empty workspace and just this package. In this case it builts, it seems to be related to the other packages in our repo. It isn't strictly an issue with this repo. Sorry for the confusion. Should I close the issue then?

SteveMacenski commented 3 months ago

Weird, I see that this works too :shrug:

LGTM