Ask Your Question
0

How to include headers from other packages

asked 2013-12-12 03:32:26 -0600

eds gravatar image

updated 2013-12-12 19:58:26 -0600

tfoote gravatar image

I'm using ROS Groovy with catkin.

I created a package1 with a file1.cpp in the src directory and a header file1.h in its include/package directory.

I need to #include this header in another file2.cpp of another package2 in the same workspace and then call those declared function.

file1.cpp doesn't have any main() function. It's only a list of functions and their body definitions.

I'm not secure with this tool because everything I tried using tutorials is not working. Please, give me full informations about what to write in every CMakeLists.txt or package.xml and how to include that header in both packages.

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-12-15 21:12:05 -0600

pkohout gravatar image

You have to say in the manifest of package2 that it need package1 to run, if I remember right I is a dependencie. After you have rebuild It then, you should be able to include it something like "packageName/HeaderName"

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-12-12 03:32:26 -0600

Seen: 925 times

Last updated: Dec 15 '13