当前位置:网站首页>ROS compilation calls the third-party dynamic library (xxx.so)
ROS compilation calls the third-party dynamic library (xxx.so)
2022-07-06 08:35:00 【Will_ Ye】
1. Problem
In the process of doing the project , Inevitable , Sometimes you need to use some third-party open source libraries , Or write your own dynamic library , Then you need to CMakeLists Add the path corresponding to these dynamic libraries , Compile .
The suffix of the dynamic library that needs to be called is generally .so, Sometimes I will encounter something except libxxx.so, also libxxx.so.x and libxxx.so.x.y.z these , Such as libzzz.so, also libzzz.so.1 and libzzz.so.1.0.0
In the suffix .so These figures after , In fact, it represents different versions , Used for version management , So the file name of the whole dynamic library is exquisite . such as libzzz.so.1.2.3,lib It is a fixed representative shared library ,zzz Is the shared library name ,.so Is a fixed suffix ,1 Indicates the major version number ,2 Indicates the minor version number ,3 Indicates the release version number .
The major version number : Incompatibility between different version numbers
Sub version number : Incremental upgrade , Backward compatibility
Release number : Error correction and performance improvement corresponding to the next version , Does not affect compatibility
And the longest name libxxx.so.x.y.z, Is the actual library file , It contains executable binary code . So you can use instructions readelf -d libzzz.so.1.2.3 Read this file .
In fact, when generating the Library , You can also directly generate only one libzzz.so As the actual library file , It depends on the individual , The standard point is that we should do a good job in library version management .
2. Method
stay ROS Of package in , Generally, two folders are created (include and lib), Deposit .h The header file and .so Dynamic library files , therefore , We just put the third-party dynamic library files into lib In the folder , Don't forget to put the relevant libxxx.so.x and libxxx.so.x.y.z Also put it in , No one can do without .

After the dynamic library file is placed , Revise it CMakeList That's all right.
cmake_minimum_required(VERSION 2.8.3)
SET(CMAKE_BUILD_TYPE Debug)
add_compile_options( -std=c++11)
project(gazebo_mobile_manipulator)
find_package(PCL 1.8 REQUIRED)
find_package(OpenCV REQUIRED)
find_package(catkin REQUIRED COMPONENTS
nav_msgs
roscpp
rospy
serial
tf
std_msgs
std_srvs
actionlib
actionlib_msgs
message_generation
geometry_msgs
pcl_conversions
pcl_ros
PCL
)
catkin_package(
CATKIN_DEPENDS roscpp rospy serial std_msgs message_runtime
INCLUDE_DIRS include
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
link_directories(
${catkin_LIB_DIRS} lib
)
add_executable(test src/test1.cpp)
target_link_libraries(test ${PCL_LIBRARIES} ${catkin_LIBRARIES} ${OpenCV_LIBRARIES} libzzz.so)
Pay attention to the last line , stay target_link_libraries Inside , Just add libzzz.so That's all right. , There is no need to add the version number that follows , adopt .so This will search for others .
then catkin_make Just compile it
边栏推荐
- 堆排序详解
- [luatos-air551g] 6.2 repair: restart caused by line drawing
- The resources of underground pipe holes are tight, and the air blowing micro cable is not fragrant?
- 【MySQL】日志
- China dihydrolaurenol market forecast and investment strategy report (2022 Edition)
- Rviz仿真时遇到机器人瞬间回到世界坐标原点的问题及可能原因
- [secretly kill little partner pytorch20 days -day01- example of structured data modeling process]
- 生成器参数传入参数
- MySQL learning record 07 index (simple understanding)
- 被破解毁掉的国产游戏之光
猜你喜欢

View computer devices in LAN

Zhong Xuegao, who cannot be melted, cannot escape the life cycle of online celebrity products

JVM performance tuning and practical basic theory - Part 1

704 二分查找

Deep analysis of C language pointer
![[MySQL] database stored procedure and storage function clearance tutorial (full version)](/img/27/e775e03b77c7195216bc50c5cbefb4.png)
[MySQL] database stored procedure and storage function clearance tutorial (full version)

Double pointeur en langage C - - modèle classique

On the day of resignation, jd.com deleted the database and ran away, and the programmer was sentenced

2022.02.13 - NC002. sort

软件卸载时遇到trying to use is on a network resource that is unavailable
随机推荐
Image, CV2 read the conversion and size resize change of numpy array of pictures
电脑F1-F12用途
sublime text中conda环境中plt.show无法弹出显示图片的问题
个人电脑好用必备软件(使用过)
China Light conveyor belt in-depth research and investment strategy report (2022 Edition)
VMware 虚拟化集群
JS pure function
Process of obtaining the electronic version of academic qualifications of xuexin.com
PLT in Matplotlib tight_ layout()
【MySQL】鎖
Problems in loading and saving pytorch trained models
3. File operation 3-with
2022.02.13 - NC004. Print number of loops
被破解毁掉的国产游戏之光
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Golang force buckle leetcode 1020 Number of enclaves
[brush questions] top101 must be brushed in the interview of niuke.com
sys.argv
[2022 广东省赛M] 拉格朗日插值 (多元函数极值 分治NTT)
Is it safe to open an account in Zheshang futures?