undefined reference to symbol 'ros::Time::now()' [closed]
Hi,
I am migrating my ros (fuerte) package from ubuntu 10.04 to 12.04. Furthermore I am migrating from boost version 1.40.0 to 1.46.1. Since I am using the boost::filesystem libraries (v2) and I do not want to change the code (to boost::filesystem v3) I add to every inclusion of "boost/filesystem.hpp" the following macro: #define BOOST_FILESYSTEM_VERSION 2.
I get the following error:
Linking CXX executable ../bin/SimpleDemo
/usr/bin/ld: /opt/ros/fuerte/lib/libroscpp.so: undefined reference to symbol 'ros::Time::now()'
/usr/bin/ld: note: 'ros::Time::now()' is defined in DSO /opt/ros/fuerte/lib/librostime.so so try adding it to the linker command line
/opt/ros/fuerte/lib/librostime.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [../bin/SimpleDemo] Error 1
make[1]: *** [CMakeFiles/SimpleDemo.dir/all] Error 2
make: *** [all] Error 2
Since I am not an experienced programmer, I would like to know what could cause this problem.
Edit 1
Manifest.xml
<package>
<description brief="object_segmentation">
object_segmentation
</description>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<depend package="roscpp"/>
<depend package="opencv2"/>
</package>
Edit 2
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()
#add subdirectories (third party software libraries) - point to folder where CMakeLists.txt files are located
add_subdirectory("${PROJECT_SOURCE_DIR}/3rdparty/MAXFLOW")
add_subdirectory("${PROJECT_SOURCE_DIR}/3rdparty/LINEMOD/linemod_tdj")
add_subdirectory("${PROJECT_SOURCE_DIR}/3rdparty/EGBIS/opencv-wrapper-egbis-2.0.0")
#include directories (including third party software)
include_directories("${PROJECT_SOURCE_DIR}/include")
include_directories(AFTER "${MAXFLOW_SOURCE_DIR}")
include_directories(AFTER "${LINEMOD_SOURCE_DIR}/include")
include_directories(AFTER "${EGBIS_SOURCE_DIR}/include")
#includes
set(DASHBOARD_INCLUDE include/dashboard/ObjectSegmentationDashboard.h)
set(ATTRIBUTES_INCLUDE include/attributes/Attributes.h)
set(CLASSIFIER_INCLUDE include/classifier/Classifier.h include/classifier/LogisticRegression.h)
set(OBJECTSEGMENTOR_INCLUDE include/objectsegmentor/ObjectSegmentor.h)
set(REGION_INCLUDE include/region/Region.h include/region/ObjectHypothesisList.h include/region/RegionMap.h include/region/IntersectionOfRegions.h)
set(APRIORISEGMENTATION_INCLUDE include/apriorisegmentation/APrioriSegmentation.h include/apriorisegmentation/MeanShiftSegmentation.h include/apriorisegmentation/FelzenszwalbHuttenlocherSegmentation.h include/apriorisegmentation/NCutSegmentation.h include/apriorisegmentation/WatershedSegmentation.h )
set(VISUALISATION_INCLUDE include/visualisation/Visualisation.h include/visualisation/AttributesInteractiveWindow.h include/visualisation/InteractiveWindow.h include/visualisation/APrioriSegmentationInteractiveWindow.h include/visualisation/RegionDescriptorInteractiveWindow.h include/visualisation/RegionGraphInteractiveWindow.h include/visualisation/ObjectHypothesesInteractiveWindow.h)
set(FEATURES_INCLUDE include/features/Features.h include/features/RegionDescriptor.h)
set(GRAPH_INCLUDE include/graph/RegionGraph.h)
set(HYPOTHESES_INCLUDE include/hypotheses/ObjectHypotheses.h)
set(SETTINGS_INCLUDE include/settings/Settings.h include/settings/FeaturesSettings.h include/settings/LogisticRegressionSettings.h include/settings/LearnerSettings.h include/settings/GroundTruthDataMakerSettings.h)
set(LEARNING_INCLUDE include/learning/Learner.h include/learning/GroundTruthDataMaker.h)
set(UTIL_INCLUDE include/util/Util.h)
set(CORE_INCLUDE ${DASHBOARD_INCLUDE} ${ATTRIBUTES_INCLUDE} ${CLASSIFIER_INCLUDE} ${OBJECTSEGMENTOR_INCLUDE} ${REGION_INCLUDE} ${APRIORISEGMENTATION_INCLUDE} ${VISUALISATION_INCLUDE} ${FEATURES_INCLUDE} ${GRAPH_INCLUDE} ${HYPOTHESES_INCLUDE} ${SETTINGS_INCLUDE} ${LEARNING_INCLUDE} ${UTIL_INCLUDE})
#endincludes
#source
set(DASHBOARD_SRC src/dashboard/ObjectSegmentationDashboard.cpp)
set(ATTRIBUTES_SRC src/attributes/Attributes.cpp)
set(CLASSIFIER_SRC ...
how does your manifest.xml look like?
See above.
can you please also post your CMakeList.txt to?
@coon: see above.