include package ??
Hi. I have written a C++ program, which goes by the name:
listener.cpp
located in:
/home/user/catkin_ws/src/project1/src/listener.cpp
Which works fine, but is unable to import one .h file:
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "std_msgs/Int8.h"
//#include <sound_play/sound_play.h>
#include <unistd.h>
Without the sound_play line, it works, and the program does what is expected. But i am needing to make use of sound_play. This is the catkin_make output when running it without commenting the line:
[100%] Building CXX object project1/CMakeFiles/project1.dir/src/listener.cpp.o
/home/user/catkin_ws/src/project1/src/listener.cpp:4:35: fatal error: sound_play/sound_play.h: No such file or directory
compilation terminated.
I do have installed audio_common, and already catkin_make'd it. It is located in:
/opt/ros/groovy/stacks/
And the terminal is "sourced" with:
source catkin_ws/devel/setup.sh
I've tried (for testing purposes) to import other things, and it seems like it only allows you to import things that are in the opt/ros/share folder. By the way, what i want to do with sound_play is more or less like documented here: test.cpp for sound_play
How may I include sound_play package? Any help is welcomed, as I think i am not coping with the include and dependency system yet. Greetings ROS community.
EDIT: So after some answers, i decided to build with rosmake, and i followed more or less the listener talker tutorial. I created a package with the same dependencies, except for adding sound_play Whenever i build, it throws an error, because it cannot use ros.h properly:
Linking CXX executable ../bin/talker
CMakeFiles/talker.dir/src/talker.cpp.o: In function `ros::Publisher ros::NodeHandle::advertise<std_msgs::String_<std::allocator<void> > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, bool)':
/opt/ros/groovy/include/ros/node_handle.h:241: undefined reference to `ros::NodeHandle::advertise(ros::AdvertiseOptions&)'
CMakeFiles/talker.dir/src/talker.cpp.o: In function `void ros::Publisher::publish<std_msgs::String_<std::allocator<void> > >(std_msgs::String_<std::allocator<void> > const&) const':
/opt/ros/groovy/include/ros/publisher.h:106: undefined reference to `ros::Publisher::Impl::isValid() const'
/opt/ros/groovy/include/ros/publisher.h:118: undefined reference to `ros::Publisher::publish(boost::function<ros::SerializedMessage ()> const&, ros::SerializedMessage&) const'
CMakeFiles/talker.dir/src/talker.cpp.o: In function `main':
/home/aimc/catkin_ws/src/include_test/src/talker.cpp:21: undefined reference to `ros::init(int&, char**, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
/home/aimc/catkin_ws/src/include_test/src/talker.cpp:28: undefined reference to `ros::NodeHandle::NodeHandle(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std ...