linking to a specific version of library (libssl) in CmakeLists.txt
Hello all;
I am trying to link MvTec Halcon libraries in my ROS indigo node this way:
cmake_minimum_required(VERSION 2.8.3)
project(tekniker_halcon_drivers)
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
sensor_msgs
std_msgs
)
find_package(PCL REQUIRED)
catkin_package(
INCLUDE_DIRS include
)
include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
/opt/halcon/include
)
link_directories(/opt/halcon/lib/x64-linux/)
link_directories(${PCL_LIBRARY_DIRS})
add_library(halcon_3d_lib src/halcon_3d_lib.cpp)
add_executable(ensenso_driver_node src/ensenso_driver_node.cpp)
add_executable(halcon3D_test_node src/halcon3D_test_node.cpp)
target_link_libraries(ensenso_driver_node ${catkin_LIBRARIES} ${PCL_LIBRARIES} halconcpp)
target_link_libraries(halcon_3d_lib ${catkin_LIBRARIES} ${PCL_LIBRARIES} halconcpp)
target_link_libraries(halcon3D_test_node ${catkin_LIBRARIES} ${PCL_LIBRARIES})
The problem I have is that when I use pcl:io module, the node links against libpq, and libpq to libssl.
When I do not include link_directories(/opt/halcon/lib/x64-linux/)
libssl is taken from /lib/x86_64-linux-gnu/
and everything works ok.
However, if add link_directories(/opt/halcon/lib/x64-linux/)
the library is taken from /opt/halcon/lib/x64-linux
.
Is there a way to specify in the CMakeLists.txt that PCL links against libssl in /lib/x86_64-linux-gnu/
and Halcon libraries against libssl in /opt/halcon/lib/x64-linux
?
How can I check differences between the two versions of libssl?
Thank you very much in advance.
Asked by altella on 2015-06-29 05:22:22 UTC
Comments
Are you aiming for one binary with two different libssl versions?
Asked by dornhege on 2015-06-29 05:55:27 UTC
So just to clarify: you don't actually need your binaries to link against the SSL provided by Halcon?
Asked by gvdhoorn on 2015-06-29 05:59:42 UTC
It would be good to link Halcon with its own version of libssl to assess correct functionality, but I need the other libssl for PCL...so, maybe yes, two versions of libssl in the same binary... could be possible?
Asked by altella on 2015-06-29 07:12:15 UTC
Maybe this is possible somehow, but my intuition says, you're gonna get linker errors, because the same symbols will be there multiple times.
Asked by dornhege on 2015-06-29 07:42:40 UTC
that's it...i think there is not a clean way to use both libraries in the same binary...
Asked by altella on 2015-06-29 07:53:44 UTC
I have to agree with @dornhege: all my experience says this cannot be (cleanly) done. If it can be done, I'd expect segfaults as well once you get past any linker errors.
Asked by gvdhoorn on 2015-06-29 07:59:53 UTC