ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to manage my header files. [closed]

asked 2013-02-11 06:44:54 -0500

kabamaru gravatar image

updated 2013-02-11 06:45:37 -0500

I have to say that my package compiles ok. But I've seen people create a different include folder where they place their include file. I find this cleaner and a better practice in general and I want to follow it. The problem is I don't know how to do it without absolute reference. I don't want to use something like that:

#include "../../include/lib/foo.hpp"

my package name lets say it is upm. I want something like

#include "upm/include/lib/foo.hpp"

or without upm even better.

I've tried

but with no success. Any suggestions? And generally how do you treat your header files? What it is considered good practice? Sorry if it's naive and a bit general.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by ayush_dewan
close date 2013-02-11 17:24:38

1 Answer

Sort by ยป oldest newest most voted

answered 2013-02-11 06:56:03 -0500

One thing u can try is create a folder "include" in ur main package directory and then create another folder inside include folder which is named as package name and the add all ur include files in it.

To include the files u have to use <package_name filename.h=""> in ur src file.

Hope this helps..

edit flag offensive delete link more


well thanks a lot i've figure it out, after all .

kabamaru gravatar image kabamaru  ( 2013-02-11 10:25:03 -0500 )edit

Question Tools


Asked: 2013-02-11 06:44:54 -0500

Seen: 158 times

Last updated: Feb 11 '13