rospeex dependency libraries error
I recently install the rospeex package and I managed to run the Talking Watch sample with the following command:
roslaunch rospeex_samples talking_watch_cpp_en_local.launch
However, if I try to make my own package (named extras) and copy-paste the same code shown in the example in a script called speech_rec.cpp I get the following error:
Linking CXX executable ../bin/speech_rec
/opt/ros/hydro/lib/librospeex_if.so: undefined reference to `ros::package::getPath(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
Is there any way to solve it? I think I'm not linking the libraries correctly (I'm new in ROS). I'm using Ubuntu 12.04, ROS distro Hydro and rosbuild. My CMakeList.txt is:
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
rosbuild_init()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
rosbuild_add_executable(speech_rec src/speech_rec.cpp)
And my manifest.xml is:
<package>
<description brief="extras">
extras
</description>
<author>Cl</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/extras</url>
<depend package="std_msgs"/>
<depend package="rospy"/>
<depend package="roscpp"/>
<depend package="roslib"/>
<depend package="rospack"/>
<depend package="opencv2"/>
<depend package="image_transport"/>
<depend package="cv_bridge"/>
<depend package="rospeex_if"/>
<depend package="rospeex_audiomonitor"/>
<depend package="rospeex_core"/>
<depend package="rospeex_launch"/>
<depend package="rospeex_msgs"/>
<depend package="rospeex_webaudiomonitor"/>
</package>