Ask Your Question
0

catkin_make can't find #include files

asked 2016-10-31 10:17:19 -0600

jacksonkr_ gravatar image
 $ catkin_make
Base path: /home/jackson/catkin_ws
Source space: /home/jackson/catkin_ws/src
Build space: /home/jackson/catkin_ws/build
Devel space: /home/jackson/catkin_ws/devel
Install space: /home/jackson/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/jackson/catkin_ws/build"
####
####
#### Running command: "make -j2 -l2" in "/home/jackson/catkin_ws/build"
####
Scanning dependencies of target polygon_plugins
[ 50%] Building CXX object pluginlib_tutorials_/CMakeFiles/polygon_loader.dir/src/polygon_loader.cpp.o
[100%] Building CXX object pluginlib_tutorials_/CMakeFiles/polygon_plugins.dir/src/polygon_plugins.cpp.o
/home/jackson/catkin_ws/src/pluginlib_tutorials_/src/polygon_plugins.cpp:2:47: fatal error: pluginlib_tutorials_/polygon_base.h: No such file or directory
 #include <pluginlib_tutorials_/polygon_base.h>
                                               ^
compilation terminated.
make[2]: *** [pluginlib_tutorials_/CMakeFiles/polygon_plugins.dir/src/polygon_plugins.cpp.o] Error 1
make[1]: *** [pluginlib_tutorials_/CMakeFiles/polygon_plugins.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/jackson/catkin_ws/src/pluginlib_tutorials_/src/polygon_loader.cpp:2:47: fatal error: pluginlib_tutorials_/polygon_base.h: No such file or directory
 #include <pluginlib_tutorials_/polygon_base.h>
                                               ^
compilation terminated.
make[2]: *** [pluginlib_tutorials_/CMakeFiles/polygon_loader.dir/src/polygon_loader.cpp.o] Error 1
make[1]: *** [pluginlib_tutorials_/CMakeFiles/polygon_loader.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j2 -l2" failed

Here is the file tree:

pluginlib_tutorial_
- CMakeLists.txt
- package.xml
- polygon_plugins.xml
+ src
 - polygon_loader.cpp
 - polygon_plugins.cpp
+ include
 + polygon_tutorials_
  - polygon_base.h
  - polygon_plugins.h

I'm lost as to why polygon_base.h is not being found.

~/catkin_ws/src/pluginlib_tutorials$ find . -name polygon_base.h
.include/pluginlib_tutorials_/polygon_base.h

I was concerned that maybe the include path was not looking in the "include" folder so I tried the absolute path as well

/home/users/jackson/catkin_ws/src/pluginlib_tutorials_/include/pluginlib_tutorials/polygon_base.h

Which still did not work. What am I missing?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-10-31 13:24:25 -0600

ahendrix gravatar image

In your CMakeLists.txt, you need to tell the compiler to look for include files in your include directory.

You can do this by adding the following line to your CMakeLists.txt:

include_directories(include)
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: 2016-10-31 10:17:19 -0600

Seen: 4,835 times

Last updated: Oct 31 '16