Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when including rospack/rospack.h #37

Closed
bit-pirate opened this issue Mar 21, 2014 · 4 comments
Closed

Errors when including rospack/rospack.h #37

bit-pirate opened this issue Mar 21, 2014 · 4 comments
Labels

Comments

@bit-pirate
Copy link

I wanted to use the Rospack class from rospack, but once I included the header, I got the following error:

/opt/ros/hydro/include/rospack/rospack.h:521:1: error: expected identifier before string constant
/opt/ros/hydro/include/rospack/rospack.h:521:1: error: expected ‘,’ or ‘...’ before string constant
/opt/ros/hydro/include/rospack/rospack.h:520:10: error: invalid use of ‘::’
/opt/ros/hydro/include/rospack/rospack.h:529:1: error: expected identifier before string constant
/opt/ros/hydro/include/rospack/rospack.h:529:1: error: expected ‘,’ or ‘...’ before string constant
/opt/ros/hydro/include/rospack/rospack.h:528:10: error: invalid use of ‘::’
@tfoote
Copy link
Member

tfoote commented Mar 21, 2014

For reference I believe it's this line: https://github.com/ros/rospack/blob/indigo-devel/include/rospack/rospack.h#L521

This sounds like a symbol collision. Do you have the problem if you include rospack.h alone or first?

@dirk-thomas
Copy link
Member

Could you please provide more information? E.g. a simple main.cpp file which exhibits the problem.

@bit-pirate
Copy link
Author

Could you please provide more information? E.g. a simple main.cpp file which exhibits the problem.

Sure, see below. The strange thing is, there seems to be a conflict with rosbag. Including rospack after a header from rosbag leads to the reported error. Including it before works fine.

#include <ros/ros.h>
#include <rosbag/bag.h> // or <rosbag/view.h>
#include <rospack/rospack.h>

int main (int argc, char** argv)
{
  ros::init(argc, argv, "rospack_test");
  return 0;
}

@dirk-thomas
Copy link
Member

This is sadly nothing rospack can address. console_bridge (which is used by rosbag internally defines e.g. logWarn (https://github.com/ros/console_bridge/blob/7aebc3367b4945d9963457549026ea137b047b7b/include/console_bridge/console.h#L68) which collides with the already long existing API of rospack.

I have filled a ticket against ros/console_bridge#18. I will mark this as closed since we can't just change the rospack API because of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants