Robotics StackExchange | Archived questions

Problem in ROS Qt Node

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: findpackage(Qt4 COMPONENTS QtCore QtGui) include(${QTUSE_FILE})

addexecutable(qttest src/qttest.cpp) targetlinklibraries(qttest ${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

Asked by newbieros on 2015-10-16 19:07:45 UTC

Comments

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

Asked by Dimitri Schachmann on 2015-10-17 07:51:19 UTC

Answers