ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

I have errors trying to catkinize MIDG II package

asked 2016-10-26 03:26:24 -0500

AbdRenawi gravatar image

updated 2017-04-25 03:13:31 -0500

gvdhoorn gravatar image

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?

edit retag flag offensive close merge delete

Comments

Please use the Preformatted Text button (the one with 101010 on it) to format things like console text, contents of CMakeLists.txt, compiler errors and code snippets.

Please use the edit button/link (below your question) to fix the formatting.

Thanks.

gvdhoorn gravatar image gvdhoorn  ( 2016-10-26 06:00:49 -0500 )edit

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 #).

gvdhoorn gravatar image gvdhoorn  ( 2016-10-26 06:01:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-04-23 02:33:55 -0500

AbdRenawi gravatar image

Solved, I created a new driver for MIDG II INS/GPS sensor that works on any platform that supports ROS. available at: https://github.com/AbdRenawi/MIDG-II-...

edit flag offensive delete link more

Question Tools

Stats

Asked: 2016-10-26 03:26:24 -0500

Seen: 225 times

Last updated: Apr 25 '17