Including C++ headers in another package
To import and include header files from a different package than the one where you're working on, it is just required to do these two things:
- Open the CMakeLists.txt (of the working package (destination), not the one where the header is defined), and add, on the find_package command, the name of the package where the header is defined:...find_package(catkin REQUIRED COMPONENTSroscppmy_roscpp_library)...
- Open the package.xml (of the working package (destination), not the one where the header is defined) and add a new line with a <depend> tag:<depend>my_roscpp_library</depend>After these two steps, you should be able to compile your project. If you're using a catkin workspace, just run the catkin_make command.For more information, read this.
Comments
Post a Comment