Undefined Reference using Cereal_Port, -l doesn't fix
Hello, I'm currently writing two ros_nodes. One is finished, and captures data from a gyro. It uses the ros cereal_port library found in the following stack: /opt/ros/fuerte/stacks/serial_communication/cereal_port/lib
I have no issues with this node compiling, and it runs perfectly in Fuerte on Ubuntu 12.04 precise.
I'm now trying to use the cereal_port library in another package, but I keep getting undefined references in libcereal_port.so to various boost functions. I've been at this for 2 days now, and I don't understand why adding -lboost_thread-mt is not enough for the undefined reference to be resolved. I've validated that the path/file for libboost_thread-mt.so exist, but I cannot eliminate the problem.
Here are the manifest.xml and CMakeLists.txt for the gyro rosnode that is currently compiling and executing properly:
manifest.xml:
<package>
<description brief="kvh_dsp_1750_ros_interface">
kvh_dsp_1750_ros_interface
</description>
<author>am3p-pc2</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http:// ros.org/wiki/kvh_dsp_1750_ros_interface</url>
<depend package="roscpp"/>
<depend package="cereal_port"/>
<export>
<cpp cflags="-I${prefix}/include" lflags="-Wl,-rpath,$prefix}/lib -L${prefix}/lib -lKVH_DSP1750"/>
</export>
</package>
CMakeLists.txt:
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)
rosbuild_init()
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
rosbuild_genmsg()
rosbuild_add_library(KVH_DSP1750 include/KVHDSP1750.h src/KVHDSP1750.cpp)
rosbuild_add_executable(dsp1750_node src/kvh_dsp_1750_ros_interface.cpp)
target_link_libraries(dsp1750_node KVH_DSP1750)
Here are the manifest.xml and CMakeLists.txt for the GPS rosnode that is NOT currently building:
manifest.xml:
<package>
<description brief="novatel_oem628_driver">
novatel_oem628_driver
</description>
<author>am3p-pc2</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http:// ros.org/wiki/novatel_oem628_driver</url>
<depend package="roscpp"/>
<depend package="cereal_port"/>
<export>
<cpp cflags="-I${prefix}/include" lflags="-Wl,-rpath,$prefix}/lib -L${prefix}/lib -lNOVATEL_LIB"/>
</export>
</package>
CMakeLists.txt:
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)
rosbuild_init()
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()
FIND_PACKAGE(Boost COMPONENTS thread)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
message("\${Boost_INCLUDE_DIR} = ${Boost_INCLUDE_DIR}")
message("\${Boost_LIBRARIES} = ${Boost_LIBRARIES}")
rosbuild_add_library(NOVATEL_LIB include/novatel.h src/lib/novatel.cpp)
#rosbuild_add_library(cereal_port /opt/ros/fuerte/stacks/serial_communication/cereal_port/include/cereal_port ...