undefined reference to `StitchedMap::get_stitch()'
Hi everyone! I am new to ROS.
I am trying to convert the Mapstitch package ( https://github.com/tu-darmstadt-ros-p... ) from Rosbuild to Catkin. However, after I created a catkin package and modified the CMakeList, there are some errors when I compile the package. Could anyone tell what's the problem?
ROS: Indigo OS: Ubuntu 14.04
Errors
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/lok/ws/devel/lib/mapstitch/mapstitch] Error 1
make[1]: *** [mapstitch/CMakeFiles/mapstitch.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX executable /home/lok/ws/devel/lib/mapstitch/main
CMakeFiles/main.dir/src/main.cpp.o: In function `main':
main.cpp:(.text+0x99f): undefined reference to `StitchedMap::StitchedMap(cv::Mat&, cv::Mat&, float)'
main.cpp:(.text+0x9e0): undefined reference to `StitchedMap::get_stitch()'
main.cpp:(.text+0xbaa): undefined reference to `StitchedMap::get_stitch()'
main.cpp:(.text+0xc5b): undefined reference to `StitchedMap::get_stitch()'
main.cpp:(.text+0xd6f): undefined reference to `StitchedMap::get_debug()'
main.cpp:(.text+0xe20): undefined reference to `StitchedMap::get_debug()'
main.cpp:(.text+0xeeb): undefined reference to `StitchedMap::~StitchedMap()'
main.cpp:(.text+0x16fc): undefined reference to `StitchedMap::~StitchedMap()'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/lok/ws/devel/lib/mapstitch/main] Error 1
make[1]: *** [mapstitch/CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j2 -l2" failed
CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3)
project(mapstitch)
find_package(catkin REQUIRED COMPONENTS
roscpp
tf
std_msgs
nav_msgs
cv_bridge
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES mapstitch
CATKIN_DEPENDS roscpp tf cv_bridge
DEPENDS system_lib OpenCV
)
include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(include ${mapstitch})
include_directories(include mapstitch)
include_directories(include tclap)
add_executable(rosmain src/rosmain.cpp)
target_link_libraries(rosmain ${catkin_LIBRARIES})
add_dependencies(rosmain ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(main src/main.cpp)
target_link_libraries(main ${catkin_LIBRARIES})
add_dependencies(main ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(mapstitch src/mapstitch.cpp)
target_link_libraries(mapstitch ${catkin_LIBRARIES})
add_dependencies(mapstitch ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})