[vtkusers] " " vs < > for includes

Marcus D. Hanwell marcus.hanwell at kitware.com
Thu Nov 19 10:53:24 EST 2009


On Thursday 19 November 2009 10:22:47 David Doria wrote:
> I noticed that most of the includes are done like this:
> #include "vtkPolyData.h"
> 
> Don't the quotes mean "look in the current directory", where
> #include <vtkPolyData.h>
> 
> means "look on the PATH"?
> 
> If this is correct, shouldn't they all use <> since we want to find
> headers in all of the subdirectories (VTK/Graphics, VTK/Filtering,
> etc), which I assume have been put on a header_path type variable by
> cmake?
> 
> It clearly works the way it is and I'm sure it is "correct" since the
> whole project does it like this, I was just curious.
> 
I think StackOverflow has some good answers to this question,

http://stackoverflow.com/questions/179213/c-include-semantics

My feeling was that inside a library you should be using "" in your 
implementation files etc. For projects using the library they should be using 
<> style includes, as they are using the system installed library headers. 

Marcus
-- 
Marcus D. Hanwell, Ph.D.
R&D Engineer, Kitware Inc.
(518) 881-4937



More information about the vtkusers mailing list