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

error: expected class-name before ‘{’ token

asked 2015-03-19 06:04:16 -0500

ROSkinect gravatar image

updated 2015-03-19 06:31:20 -0500

Hi there !

I try to compile a package that I found in the internet but I still get this error:

  In file included from /home/ros/rosbuildstaubli/staubli3/src/controller.cpp:14:0:
  /home/ros/rosbuildstaubli/staubli3/include/command.h: At global scope:
  /home/ros/rosbuildstaubli/staubli3/include/command.h:24:1: error: expected class-name before ‘{’ token
  /home/ros/rosbuildstaubli/staubli3/include/command.h:205:1: error: expected class-name before ‘{’ token
  /home/ros/rosbuildstaubli/staubli3/include/command.h: In constructor ‘staubli::command::Request::Request()’:
  /home/ros/rosbuildstaubli/staubli3/include/command.h:57:27: error: expected class-name before ‘(’ token
  /home/ros/rosbuildstaubli/staubli3/include/command.h:57:27: error: expected ‘{’ before ‘(’ token

The class Request heritate from ros::Message and this is what cause the errors, each time I use:

class Request : public ros::Message

This is the headers that I have in each those two files


 #include <string>
 #include <cstring>
 #include <vector>
 #include <map>
 #include "ros/message.h"
 #include "ros/time.h"


 #include "TX60L.h"
 #include <iostream>
 #include <algorithm>
 #include <ros/ros.h>
 #include <std_msgs/String.h>
 #include <sstream>
 #include "command.h"       //command service of staubli
 #include "controller.h"

I'm using ros-Hydro ubuntu 12.04

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2015-03-19 06:12:11 -0500

ahendrix gravatar image

updated 2015-03-19 06:17:06 -0500

The ros::Message class appears to be deprecated and has been removed. From a quick look through the version history, it looks like it was removed some time before the Fuerte release.

edit flag offensive delete link more


I'm using Hydro

ROSkinect gravatar image ROSkinect  ( 2015-03-19 06:12:52 -0500 )edit

It's usually a good idea to include your ROS distro in your questions. I checked the version history as far back as I was able to (Fuerte), and didn't find a version where the Message class was available.

ahendrix gravatar image ahendrix  ( 2015-03-19 06:18:18 -0500 )edit

Question Tools



Asked: 2015-03-19 06:04:16 -0500

Seen: 1,458 times

Last updated: Mar 19 '15