当前位置: 代码迷 >> 综合 >> ros 用静态库
  详细解决方案

ros 用静态库

热度:80   发布时间:2024-02-19 08:57:54.0
add_executable(test_pkg src/test_pkg.cpp)
target_link_libraries(test_pkg ${catkin_LIBRARIES}multiply /home/xp/ADS-master/AdsLib-Linux.a pthread
)

这里我用的是AdsLib-Linux.a,为了使用多线程在后边加入了pthread参数

 

 

然后在工程中加入相应的头文件位置(可以放在工程里,使用相对路径更好)

#include "/home/xp/Downloads/catkin_test/src/test_package/include/AdsLib.h"
#include "/home/xp/Downloads/catkin_test/src/test_package/include/AdsNotificationOOI.h"
#include "/home/xp/Downloads/catkin_test/src/test_package/include/AdsVariable.h"

 

  相关解决方案