[ros-users] linking shared library

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Dan Lazewatsky
日付:  
To: ros-users
題目: [ros-users] linking shared library
Hi everyone,
I have a stack with a few packages, an one of the packages (let's say
package A) needs to link a shared library from one of the other
packages (package B), but I'm having trouble to get rosmake/cmake look
in the right place. If I try to call any function in the so from B, I
get "undefined reference to `SomeFunctionFromB()"

Here's the CMakeLists.txt from A:

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

rosbuild_init()

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

rosbuild_add_executable(${PROJECT_NAME} src/main.cc)
target_link_libraries(${PROJECT_NAME} B)

Any suggestions?

Thanks,
-Dan