[ros-users] linking shared library

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Dan Lazewatsky
Date:  
To: ros-users
Subject: [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