Ask Your Question

moustafaessar's profile - activity

2019-08-16 11:57:14 -0500 received badge  Taxonomist
2017-03-27 10:36:14 -0500 received badge  Famous Question (source)
2016-09-29 03:00:16 -0500 received badge  Notable Question (source)
2016-09-27 10:01:03 -0500 received badge  Popular Question (source)
2016-09-27 09:25:01 -0500 commented answer syntax error near unexpected token `(' `int main(int argc, char **argv)'

It works! Thank you

2016-09-27 09:15:29 -0500 received badge  Scholar (source)
2016-09-27 09:15:27 -0500 received badge  Supporter (source)
2016-09-27 08:12:30 -0500 commented question syntax error near unexpected token `(' `int main(int argc, char **argv)'

The permissions: i checked allow executing file as program, I'm using rosrun hamo demo_topic_publisher.cpp to run executable file after i modified package.xml and CMakeLists.txt NOTE: i'm following Mastering_ROS_for_Robotics_Programming book commands

2016-09-27 07:33:09 -0500 received badge  Editor (source)
2016-09-27 06:48:08 -0500 asked a question syntax error near unexpected token `(' `int main(int argc, char **argv)'

when i build the entire workspace it run well as i think but there are some warnings appears

also gives me this two lines when i run the node

 /home/moustafa/catkin_ws/src/hamo/src/demo_topic_publisher.cpp: line 5: syntax error near unexpected token `('
 /home/moustafa/catkin_ws/src/hamo/src/demo_topic_publisher.cpp: line 5: `int main(int argc, char **argv)'

build output:

Base path: /home/moustafa/catkin_ws
Source space: /home/moustafa/catkin_ws/src
Build space: /home/moustafa/catkin_ws/build
Devel space: /home/moustafa/catkin_ws/devel
Install space: /home/moustafa/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/moustafa/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/moustafa/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/moustafa/rover_ws/devel;/home/moustafa/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/moustafa/rover_ws/devel;/home/moustafa/catkin_ws/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/moustafa/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.1
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - hamo
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'hamo'
-- ==> add_subdirectory(hamo)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Configuring done
CMake Warning (dev) at hamo/CMakeLists.txt:200 (add_dependencies):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.
  The dependency target "mastering_ros_demo_pkg_generate_messeges_cpp" of
  target "demo_topic_subscriber" does not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.
CMake Warning (dev) at hamo/CMakeLists.txt:199 (add_dependencies):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.
  The dependency target "mastering_ros_demo_pkg_generate_messeges_cpp" of
  target "demo_topic_publisher" does not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /home/moustafa/catkin_ws/build
####
#### Running command: "make -j4 -l4" in "/home/moustafa/catkin_ws/build"
  ####
  [ 50%] Built target demo_topic_subscriber
  [100%] Built target demo_topic_publisher

Thanks