Problem in ROS Qt Node

asked 2015-10-16 19:07:45 -0500

newbieros gravatar image

I saw an example:

#include "QDebug"
#include "ros/ros.h"

int main(int argc, char** argv)
{
  ros::init(argc, argv, "Qt_test");
  qDebug()<<"Hello world";
    return 0;
}

Here I made changes in cmakelist.txt as: find_package(Qt4 COMPONENTS QtCore QtGui) include(${QT_USE_FILE})

add_executable(qt_test src/qt_test.cpp) target_link_libraries(qt_test ${QT_LIBRARIES})

Now I tried to do catkin_make then I get the problem:

error: expected primary-expression before ‘int’ ros::init(int argc, char **argv,"qt_test");

error: expected primary-expression before ‘int’ ros::init(int argc, char **argv,"qt_test");

Can any one help this problem or should I need to do changes, any suggestions please. Thanks

edit retag flag offensive close merge delete

Comments

is this the entire qt_test.cpp ? the compiler message suggest that it actually says ros::init(int argc, char **argv,"qt_test");

Dimitri Schachmann gravatar image Dimitri Schachmann  ( 2015-10-17 07:51:19 -0500 )edit