Ask Your Question

Including generated headers from devel/include space

asked 2017-11-08 03:37:43 -0600

kotoko gravatar image


I have a package, let's call it gen. It is built under catkin kinetic and I can see the gen.h in workspace/devel/include.
In another package, let's call it toCompile. The code is unable to find gen.h

workspace/src/toCompile/include/toCompile/source_toCompile.h:23:27: fatal error: "gen/gen.h": No such file or directory

I have tried to apply a previous question A but I don't understand what should be inside It still can't find the header.
Also tried to add (include ${CATKIN_DEVEL_PREFIX}/include) but it makes no difference.

cmake_minimum_required(VERSION 2.8.3)

find_package(catkin REQUIRED COMPONENTS roscpp gen)

include_directories(include ${Eigen_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
include_directories(include ${CATKIN_DEVEL_PREFIX}/include)

    CATKIN_DEPENDS roscpp gen
    INCLUDE_DIRS  include ${Eigen_INCLUDE_DIRS} 
    CFG_EXTRAS export_flags.cmake 

The export_flags just has SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

I assuming the headers are already in the correct place (devel/include) it's just a question of pointing catkin in the right direction. Also, this worked fine in indigo and broke in kinetic.

Thank you for any help!

edit retag flag offensive close merge delete


How did you get your gen.h installed to workspace/devel/include? All of the examples I could find don't actually copy the headers there -- I can still compile fine, but I'd like to have all the headers in a central place for ease of use in my IDE

davrsky gravatar image davrsky  ( 2018-01-03 13:16:29 -0600 )edit

I ended up not using the code I was trouble with so no idea, sorry.

kotoko gravatar image kotoko  ( 2018-01-05 10:08:48 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-14 15:33:34 -0600

Your question is similar to this one (with answer):

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



Asked: 2017-11-08 03:37:43 -0600

Seen: 351 times

Last updated: Nov 14 '19