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

invoking "make" failed

asked 2015-11-10 06:13:01 -0600

Morpheus gravatar image

updated 2015-11-10 21:24:52 -0600

I have built this node before with out problems, but now it won't make. I am using Hydro, on Ubuntu 12.4. Here is the error that I get:

leaf@leaf:~$ cd catkin_ws
leaf@leaf:~/catkin_ws$ catkin_make
Base path: /home/leaf/catkin_ws
Source space: /home/leaf/catkin_ws/src
Build space: /home/leaf/catkin_ws/build
Devel space: /home/leaf/catkin_ws/devel
Install space: /home/leaf/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/leaf/catkin_ws/build"
####
####
#### Running command: "make -j2 -l2" in "/home/leaf/catkin_ws/build"
####
[  3%] Built target leaf_teleop_joystick
[  3%] Built target nav_msgs_generate_messages_lisp
Linking CXX executable /home/leaf/catkin_ws/devel/lib/leaf_base/leaf_base
[  3%] Built target std_msgs_generate_messages_lisp
[  3%] Built target geometry_msgs_generate_messages_lisp
[  3%] Built target nav_msgs_generate_messages_py
[  3%] Built target std_msgs_generate_messages_py
[  3%] Built target geometry_msgs_generate_messages_py
[  3%] Built target nav_msgs_generate_messages_cpp
[  3%] Built target std_msgs_generate_messages_cpp
[  3%] Built target geometry_msgs_generate_messages_cpp
[  7%] Built target leaf_socket
[ 22%] Built target leaf_socket_generate_messages_py
[ 33%] Built target leaf_socket_generate_messages_cpp
[ 44%] Built target leaf_socket_generate_messages_lisp
[ 51%] Built target neato_laser_publisher
[ 62%] Built target leaf_base_generate_messages_lisp
[ 77%] Built target leaf_base_generate_messages_py
[ 88%] Built target leaf_base_generate_messages_cpp
[ 88%] Built target leaf_socket_generate_messages
[ 88%] Built target leaf_base_generate_messages
CMakeFiles/leaf_base.dir/src/DataConversion.cpp.o: In function `Leaf_dataConvert()':
DataConversion.cpp:(.text+0x311): undefined reference to `FwdSeqnum'
DataConversion.cpp:(.text+0x326): undefined reference to `LispFwdModeDone'
DataConversion.cpp:(.text+0x330): undefined reference to `TurnSeqnum'
DataConversion.cpp:(.text+0x345): undefined reference to `LispTurnModeDone'
DataConversion.cpp:(.text+0x514): undefined reference to `LispFwdModeDone'
DataConversion.cpp:(.text+0x51e): undefined reference to `LispTurnModeDone'
DataConversion.cpp:(.text+0x528): undefined reference to `CmdsMsg'
collect2: ld returned 1 exit status
make[2]: *** [/home/leaf/catkin_ws/devel/lib/leaf_base/leaf_base] Error 1
make[1]: *** [leaf_base/CMakeFiles/leaf_base.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed
leaf@leaf:~/catkin_ws$

Here is my CMake file:

cmake_minimum_required(VERSION 2.8.3)
project(leaf_base)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS geometry_msgs nav_msgs roscpp rospy std_msgs tf message_generation)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

#######################################
## Declare ROS messages and services ##
#######################################

## Generate messages in the 'msg' folder
 add_message_files(
   FILES
   Leaf_cmds.msg
   Leaf_data.msg
   Leaf_emot.msg
 )

## Generate services in the 'srv' folder
# add_service_files(
#   FILES
#   Service1.srv
#   Service2.srv
# )

## Generate added messages and services with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   geometry_msgs   nav_msgs   std_msgs
 )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES leaf_base
#  CATKIN_DEPENDS geometry_msgs nav_msgs roscpp rospy std_msgs tf
   CATKIN_DEPENDS  message_runtime
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be ...
(more)
edit retag flag offensive close merge delete

Comments

Could you remove the comments from the CMakeLists? It's hard to read if ~90% are ignored.

NEngelhard gravatar image NEngelhard  ( 2015-11-10 09:35:59 -0600 )edit

Have added package.xml

Morpheus gravatar image Morpheus  ( 2015-11-10 21:26:07 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-11-10 13:20:37 -0600

William gravatar image

This looks like a generic C++ error. I believe this is happening because you declare things like FwdSeqnum (and use them in the function Leaf_dataConvert()) but you never include or link against anything which _defines_ them, see:

http://www.cprogramming.com/declare_v...

The solution will be to link your executable against an additional library which you are currently not linking against and provides the definition of these missing symbols or changing your code so that the declarations and definitions of your functions match.

edit flag offensive delete link more

Comments

The strange thing is that it has worked fine before as it is. Could some ROS dependency have been lost?

Morpheus gravatar image Morpheus  ( 2015-11-10 13:51:20 -0600 )edit

You might not be finding and using a dependency that the rosmake package was using? Check each of the dependencies of the package and look at the manifest.xml for each of them and look for link flags in the export section as a hint.

William gravatar image William  ( 2015-11-10 14:13:08 -0600 )edit
0

answered 2015-11-10 11:19:36 -0600

joq gravatar image

It looks like leaf_base also contains a C++ program that references its own messages. Is that true?

If so, please update your question to show how that program is compiled. Perhaps it is missing the required add_dependencies() command to ensure that target is built after the message headers.

See: http://docs.ros.org/jade/api/catkin/h...

edit flag offensive delete link more

Question Tools

Stats

Asked: 2015-11-10 06:13:01 -0600

Seen: 1,155 times

Last updated: Nov 10 '15