Files not found when using catkin build after catkin config --install
I am trying to switch over from catkin_make
to catkin-tools
for building my stack. Currently, when I have used catkin_make
, if I want to install, I just run catkin_make install
and it works well. However, when trying to use catkin-tools
, dependent packages seem unable to find dependencies.
For instance, there is a utils
package that builds relatively early on. Many packages depend on it. When just running catkin build
, everything works fine. However, when I run catkin config --install
and catkin build
, I will see utils
complete (shows Finished <<< utils [xx seconds]
) and a bunch of dependent packages start.
For each of those, the build then fails and highlights #include
-ing a header file from utils
as the reason for failure. There are several different headers that show failure, so it isn't a specific file, but not finding the entire package.
An example is given below:
In file included from path/to/catkin_ws/src/stack/drivers/driver1/src/driver1_node.cpp:1:10: fatal error: 'utils/file_utils.h' file not found
In the CMakeLists.txt
for utils
, there is an install command:
install(TARGETS
utils
ARCHIVE_DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY_DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
When I look in catkin_ws/install/lib
, I see libutils.so
, both when I use catkin_make
and catkin build
. I am quite confused about what to do from here.
At the moment, I will probably maintain compatibility with both catkin build
and catkin_make
, and use catkin_make install
for actually installing the stack, while I use catkin build
for development.
Did you remember to: source devel/setup.bash?
Headers don't get installed by
install(TARGETS utils [..])
, but need a separateinstall(..)
line.