Re: [ros-users] Include convention for ROS messages, etc.

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: Rob Wheeler
Date:  
To: ros-users
Subject: Re: [ros-users] Include convention for ROS messages, etc.
Both work. The angle brackets are preferable because this is a "system"
include file specified with the -I option to the compiler. From the gcc
documentation:

2.1 Include Syntax

Both user and system header files are included using the preprocessing
directive `#include'. It has two variants:
#include <file>This variant is used for system header files. It searches for
a file named file in a standard list of system directories. You can prepend
directories to this list with the -I option (see
Invocation<http://gcc.gnu.org/onlinedocs/cpp/Invocation.html#Invocation>).

#include "file"This variant is used for header files of your own program. It
searches for a file named file first in the directory containing the current
file, then in the quote directories and then the same directories used for <
file>. You can prepend directories to the list of quote directories with the
-iquote option.

On Wed, Aug 25, 2010 at 9:50 AM, Joel Cartwright <>wrote:

> Hello all,
>
> I have a question about ROS C++ include convention: For header files
> from another package, which include method is preferable?
>
>        #include <geometry_msgs/Twist.h>

>
> or
>        #include "geometry_msgs/Twist.h"

>
> Both compile correctly, and both are seen in the standard ROS stacks.
>
> Joel
> --
> Research Assistant
> Ocean Systems Laboratory
> Heriot-Watt University, UK
> _______________________________________________
> ros-users mailing list
>
> https://code.ros.org/mailman/listinfo/ros-users
>