Ask Your Question
0

Including generated headers from devel/include space

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

kotoko gravatar image

Hello,

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 foo.h.in. 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)
project(mav_planning_utils)

find_package(catkin REQUIRED COMPONENTS roscpp gen)

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

catkin_package(
    CATKIN_DEPENDS roscpp gen
    INCLUDE_DIRS  include ${Eigen_INCLUDE_DIRS} 
    LIBRARIES yaml-cpp ${PROJECT_NAME} ${PROJECT_NAME}_timing ${PROJECT_NAME}_rpoly
    CFG_EXTRAS export_flags.cmake 
)
add_subdirectory(src/library)
add_subdirectory(src/test)
add_subdirectory(src/nodes)

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

Comments

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 imagedavrsky ( 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 imagekotoko ( 2018-01-05 10:08:48 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

Your question is similar to this one (with answer): https://answers.ros.org/question/2019...

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

2 followers

Stats

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

Seen: 216 times

Last updated: Nov 14