Why isn't this valid syntax?
Because the syntax for #include
preprocessing directive is cpp.include for example:
# include " q-char-sequence " new-line
The (
)
characters are not allowed there. Multiple "
are also not allowed, and q-char is any member of the source character set **except** new-line and "
.
why not add this as a feature for the preprocessor to?
Because it would require work. To implement it.
are there any preprocessors that support this syntax?
I very much doubt. No.
My thinking is that you could do something like..
And for limited cases you kind-of can, the form of preprocessing directive takes:
# include pp-tokens new-line
For the usages, see this question. However not everything is possible, see this answer.
If you then were to move "lib1" elsewhere in your project, you would only need to adjust config.h.
No, the typical solution is to add include paths to your compiler. Then if you were to move lib1
, you would change your build and compiler options, without any modification to the source code.
Keep your #include
very simple - they are a very crude way to raw include other files. There is no reason to generate #include
paths.