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

Build errors in eclipse

asked 2012-09-29 16:15:09 -0500

TurtleBot_Fan gravatar image

updated 2014-01-28 17:13:47 -0500

ngrennan gravatar image

Using Ubuntu Precise 64 bit. Successfully installed ROS Fuerte and did Beginner Tutorials.

Installed Java JRE 6 Installed Eclipse for C++ Developers (Juno)

Performed all instructions at http://www.ros.org/wiki/IDEs up to, but not including: 5. Running and debugging your executables within Eclipse

I had selected the Beginners_tutorials package (directory) as my project. I selected talker.cpp in the Eclipse IDE to see the code and build it.

I got the following errors:

    Description Resource    Path    Location    Type
    Method 'sleep' could not be resolved    talker.cpp  /beginner_tutorials/src line 148    Semantic Error
    Field 'data' could not be resolved  talker.cpp  /beginner_tutorials/src line 122    Semantic Error
    Function 'ROS_INFO' could not be resolved   talker.cpp  /beginner_tutorials/src line 124    Semantic Error
    Function 'ok' could not be resolved talker.cpp  /beginner_tutorials/src line 109    Semantic Error
    Type 'std_msgs::String' could not be resolved   talker.cpp  /beginner_tutorials/src line 118    Semantic Error
    Method 'publish' could not be resolved  talker.cpp  /beginner_tutorials/src line 133    Semantic Error
    Function 'spinOnce' could not be resolved   talker.cpp  /beginner_tutorials/src line 142    Semantic Error
    Field 'data' could not be resolved  talker.cpp  /beginner_tutorials/src line 124    Semantic Error
    Method 'c_str' could not be resolved    talker.cpp  /beginner_tutorials/src line 124    Semantic Error
    Field 'advertise' could not be resolved talker.cpp  /beginner_tutorials/src line 80 Semantic Error
    Type 'ros::Publisher' could not be resolved talker.cpp  /beginner_tutorials/src line 80 Semantic Error
    Type 'ros::Rate' could not be resolved  talker.cpp  /beginner_tutorials/src line 89 Semantic Error
    Symbol 'String' could not be resolved   talker.cpp  /beginner_tutorials/src line 80 Semantic Error
    make: *** No rule to make target `/cmake.mk'.  Stop.    beginner_tutorials          C/C++ Problem
    Type 'ros::NodeHandle' could not be resolved    talker.cpp  /beginner_tutorials/src line 49 Semantic Error
    Function 'init' could not be resolved   talker.cpp  /beginner_tutorials/src line 39 Semantic Error
make: /cmake.mk: No such file or directory  Makefile    /beginner_tutorials line 1  C/C++ Problem

In the IDE I have 2 include directives at the top of the talker.cpp file that give the following message:
Unresolved inclusion: "ros/ros.h"
Unresolved inclusion: "std_msgs/String.h"

Here is the talker.cpp file:

#include "ros/ros.h"
#include "std_msgs/String.h"
#include <sstream>

/** include description
 *
 * ros/ros.h includes all headers necessary for most common public pieces of the ROS system
 * std_msgs/String.h includes the std_msgs/String message, which resides in the std_msgs package.
 * This is a header generated automatically from the String.msg file in that package. For more
 * information on message definitions, see the msg page.
 */

/** File flow description
 * This tutorial demonstrates simple sending of messages over the ROS system.
 * This is a Publisher Node
 * Here's the condensed version of what's going on:
 *
 * 1- Initialize the ROS system
 * 2- Advertise that we are going to be publishing std_msgs/String messages 
 *    on the chatter topic to the master
 * 3- Loop while publishing messages to chatter 10 times a second
 */
int main(int argc, char **argv)
{
  /** ros::init() function description ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2012-09-30 00:07:29 -0500

So i assume that you started Eclipse from an Icon/GUI and not from the terminal. The Problem here is that the environment Variables of the .bashrc are not in use. Therefore you need to execute also Steep 5 or just start Eclipse from a Terminal instead. If you start it from terminal the environment Variables are in use and the packages can be found (of course assuming that your ROS_PACKAGE_PATH contains them, can be checked by roscd + A_PACKAGE or "echo $ROS_PACKAGE_PATH")

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-09-29 16:15:09 -0500

Seen: 3,896 times

Last updated: Sep 30 '12