Ask Your Question
0

error: expected class-name before ‘{’ token

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

ROSkinect gravatar image

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

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

commande.h:

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

controller.cpp:

 #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
0

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

ahendrix gravatar image

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

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

Comments

I'm using Hydro

ROSkinect gravatar imageROSkinect ( 2015-03-19 06:12:52 -0600 )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 imageahendrix ( 2015-03-19 06:18:18 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 900 times

Last updated: Mar 19 '15