0
$\begingroup$

Rosanswers logo

Hey there,

i've a problem using the getPath() function from roslib package. I need the package path to read out some images for a gui. In ROS Electric the code snippet below works, but since the import to ROS Fuerte I get following error while linking the package:

...RoombaDashboard.cpp:43: undefined reference to `ros::package::getPath(std::basic_string<char, std::char_traits, std::allocator > const&)'

#include <ros/package.h>

...

/* Load PNGs */
wxString imgPath = wxString::FromAscii((
    ros::package::getPath("roomba_dashboard") + "/gui/").c_str());

Does anyone have an idea why this error occurs!? The source code seems to be right...

Thank you und best regards Stefan


Originally posted by Dark-Valentine on ROS Answers with karma: 146 on 2012-07-23

Post score: 3

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The problem is solved...

It seems that the roslib package isn't a dependency of roscpp anymore. Adding the roslib package as dependency to my package makes it linkable.

roscpp manifest.xml in electric

...
<depend package="roslib"/>
...

roscpp manifest.xml in fuerte

<package>
  <description brief="ROS C++ client library">

...

  </description>
  <author>Morgan Quigley [email protected], Josh Faust [email protected], Brian Gerkey [email protected], Troy Straszheim straszheim@will$
  <license>BSD</license>
  <review status="Doc reviewed"/>
  <url>http://ros.org/wiki/roscpp</url>
  <depend package="roslang"/>
  <export>
    <cpp cflags="`PKG_CONFIG_PATH=${prefix}/../../lib/pkgconfig pkg-config --cflags roscpp`"
         lflags="`PKG_CONFIG_PATH=${prefix}/../../lib/pkgconfig pkg-config --libs roscpp`"/>
    <roslang cmake="${prefix}/rosbuild/roscpp.cmake"/>
  </export>
  <rosdep name="pkg-config"/>

</package>

Thanks anyway!


Originally posted by Dark-Valentine with karma: 146 on 2012-07-23

This answer was ACCEPTED on the original site

Post score: 10

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.