I have errors trying to catkinize MIDG II package
I am trying to catkinize a package I found on Github to run my "Microrobotics MIDG II INS/GPS" sensor on ROS.
I used "catkinize" and follwed the instructions to edit my CMakeList
and package files.
After finishing all steps I am getting this error messge and I couldn't find any help to fix it.
...
midgPacket.cpp:(.text+0xa15): undefined reference to `ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)'
midgPacket.cpp:(.text+0xa1f): undefined reference to `ros::console::checkLogLocationEnabled(ros::console::LogLocation*)'
midgPacket.cpp:(.text+0xa6a): undefined reference to `ros::console::print(ros::console::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/renawi/catkin_ws/devel/lib/midg/Midg] Error 1
make[1]: *** [midg/CMakeFiles/Midg.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
My CMakeList file:
cmake_minimum_required(VERSION 2.8.3)
project(midg)
find_package(catkin REQUIRED COMPONENTS roscpp geometry_msgs std_msgs sensor_msgs message_generation)
include_directories(include ${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS} ${GSTREAMER_INCLUDE_DIRS})
# 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)
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/include)
#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
add_message_files(
DIRECTORY msg
FILES
IMU.msg
)
#uncomment if you have defined services
#add_service_files(
# FILES
# IMU.srv
#)
#common commands for building c++ executables and libraries
#add_library(${PROJECT_NAME} src/Midg_II.cpp)
#target_link_libraries(${PROJECT_NAME} Midg)
#target_link_libraries(${midg}-test ${midg})
#add_executable(midg midg/midg.cpp)
#target_link_libraries(example ${PROJECT_NAME})
#rosbuild_find_ros_package(mst_common)
#INCLUDE_DIRECTORIES(${mst_common_PACKAGE_PATH}/include)
## Generate added messages and services with any dependencies listed here
generate_messages(DEPENDENCIES geometry_msgs std_msgs)
#generate_messages()
# catkin_package parameters:
#http://ros.org/doc/groovy/api/catkin/html/dev_guide/generated_cmake_api.html
#catkin-package
# TODO: fill in what other packages will need to use this package
catkin_package(CATKIN_DEPENDS geometry_msgs std_msgs message_runtime roscpp sensor_msgs)
#install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# )
# PATTERN ".svn" EXCLUDE
add_executable(Midg src/Midg_II.cpp src/drivers/midgPacket.cpp)
add_dependencies(Midg ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
There are many of the "undefined reference to..." messages showing up before the error message
Any help?
Please use the Preformatted Text button (the one with
101010
on it) to format things like console text, contents ofCMakeLists.txt
, compiler errors and code snippets.Please use the edit button/link (below your question) to fix the formatting.
Thanks.
Also: when posting
CMakeLists.txt
(thanks for that btw, always a good idea when posting compiler and/or linker errors), please remove all the boilerplate comments from them (lines starting with#
).