@vnovelo, please provide more information. I will suggest some solutions, but none of them may work since you didn't give too much information.
WARNING! According to apriltags_ros package, it only supports ROS Indigo distribution. If you are trying to use this package with ROS Kinetic, it may not be possible and the error might be caused by this!
1-) After installing april_tags_ros package did you build it with catkin_make? All you need to is going catkin_ws directory and typing catkin_make
.
2-) Did you source the setup.bash file? Try:
source catkin_ws/source/devel.setup.bash
You need to source in each terminal you call ros nodes. If you don't want to source everytime, add above command to .bashrc
3-) If you did previous two steps, and still couldn't get the node working, open CMakeLists.txt file inside of april_tags_ros package and check the lines:
add_executable(apriltags_ros src/apriltags_ros/april_tag_detector_node.cpp )
If it doesn't exist, add this line. However, probably it exists and your problem is caused by the reason in WARNING! part.
I hope this helps. Don't forget to mark this comment as answer!
that's a compiler error, while your question title and part of the question text asks how to "run a cpp file". Those are two different things.
.cpp
files are first compiled. The objects then linked. The resulting binary is then executed (or "run").Could you please update your question to make it clear where the actual problems are?