On 01/03/2023 04:42, gnuric wrote:
h-0.h:#include "include-1/h-1.h"
h-0.h:
h-0.h:extern int h0;
include-1/h-1.h:
include-1/h-1.h:#include "include-2/h-2.h"
...
You have two #include directives in your example, which are
processed recursively according to the preprocessor rules. What I
had in mind was one #include preprocessor directive (similar to
one #+INCLUDE: 'directive' in Org) and a non-preprocessor
directive (`file:' in Org).

My idea was that second include should simulate a link relative to the include-1/h-1.h file. I have no idea which feature of cpp may be used to distinguish behavior of include and link in respect to relative paths.

My expectation is that relative paths are resolved in respect to the file where they reside. I admit that in some cases included file may be a kind of template, so it may add e.g. a logo specific to each project. However, perhaps, I would prefer to define a macro.

Notice that CPP has another feature: include path, so while searching for a file directories from a list tried till file is found:

#include <file.h>

and

cpp -I /usr/include/lib1 -I /usr/include/lib2

Org does not have such concept.


Reply via email to