Boost error: ‘f’ cannot be used as a function
I encountered a really strange error. I am writing a really simple code. Mostly still empty and just learning how to write node in C++. My code consist of 3 files.
RoverMove.cpp
#include "rover_move/rover_move.h"
int main(int argc, char** argv) {
ros::init(argc, argv, "RoverMove");
ros::NodeHandle n;
ros::Subscriber goal_sub;
ros::Publisher vel_pub;
goal_sub = n.subscribe<geometry_msgs::Twist>("goal", 1, "goal_call_back");
vel_pub = n.advertise<geometry_msgs::Twist>("cmd_vel", 1);
ros::spin();
return 0;
}
rover_move.h
#include "ros/ros.h"
#include"geometry_msgs/Twist.h"
#ifndef ROVER_MOVE_H
#define ROVER_MOVE_H
void goal_call_back(geometry_msgs::Twist goal);
#endif /* ROVER_MOVE_H */
RoverMoveLib.cpp
#include "rover_move/rover_move.h"
void goal_call_back(geometry_msgs::Twist goal){
// still empty
}
I have input necessary config in CMake file and I got this error:
Can anyone help me why this happened? I just want to try a simple code. Publishing and subscribng to Twist type message.
It would help if you edit your question and add the contents of your
CMakeLists.txt
file. Please copy and paste that file and any terminal output into code blocks, that makes it easier to read, search, and copy/paste.