[ADMB Users] Including a header file

Arni Magnusson arnima at hafro.is
Sat Oct 29 08:43:34 PDT 2011


Since admodel.h is neither in the current directory nor part of the 
compiler, it is on a middle ground that has not been clearly explained in 
the C++ standard until a few weeks ago, with the publication of the 2011 
standard (ISO/IEC 14882:2011). The free draft can be downloaded from

   http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf

Section 16.2, Note 7:

"[I]n general programmers should use the < > form for headers provided 
with the implementation [=compiler], and the " " form for sources outside 
the control of the implementation [=compiler]. For instance:

   #include <stdio.h>
   #include <unistd.h>
   #include "usefullib.h"
   #include "myprog.h"

In my mind, "usefullib.h" and "myprog.h" are analogous to "admodel.h" and 
"simple.htp". When the standard says that "usefullib.h" is outside the 
control of the compiler, my interpretation is that it's included using the 
-Idir compiler option.

---

This is not really important, but I wanted to tell everyone about the 
brand new C++11 standard, as an important reference for ADMB users and 
developers. It's quite readable, compared to many language standards.

Arni



On Fri, 28 Oct 2011, dave fournier wrote:

> my understanding is that
>
>   #include "filename"
>
> means include the file from the current directory while
>
>  #include <filename>
>
> means search all the include directories (such as those in -I dir) for 
> the file.
>



More information about the Users mailing list