【发布时间】:2019-06-13 17:21:53
【问题描述】:
我正在尝试构建这个 ROS 包 https://github.com/toddhester/rl-texplore-ros-pkg,但它无法构建 'rl_experiment' 并出现以下错误:
/usr/bin/ld: cannot find -lagentlib
/usr/bin/ld: cannot find -lenvlib
collect2: error: ld returned 1 exit status
我正在使用 ROS Kinetic。共享库确实存在于文件夹 /texplore/devel/.private/rl_env/lib/ 和 /texplore/devel/.private/rl_agent/lib/ 中,符号链接位于 /texplore/devel/lib/
我尝试了以下方法:
(1) 将 /texplore/devel/lib/ 导出到 LD_LIBRARY_PATH
(2) 为 /texplore/src/rl_experiment/src 中的库添加符号链接
(3) 将库路径添加到 target_link_libraries
target_link_libraries(experiment agentlib envlib ${catkin_LIBRARIES}
"/media/usr/texplore/devel/lib/libagentlib.so"
"/media/usr/texplore/devel/lib/libenvlib.so")
(4)设置链接器的搜索路径
SET(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,/media/usr/texplore/devel/lib/")
没有用。最后,我将符号链接添加到 /usr/local/lib 并且它起作用了。但我不想要这个文件夹中的符号链接。
所以链接器根本不搜索构建树。我的问题是,为什么catkin 没有在catkin_LIBRARIES 中添加链接器路径?我以前构建过 ROS 包,但无法理解为什么这个特定的包不起作用。
【问题讨论】: