Is there a way to concatenate 2 strings literals to form an include path?
#define INCLUDE_DIR "/include"
#include INCLUDE_DIR "/dummy.h"
It really seems this is not possible. I will report here the relevant section from Eric Postpischil's answer (he doesn't seem to be active anymore).
The compiler will do macro replacement on an
#includeline (per C 2011 [N1570] 6.10.2 4), but the semantics are not fully defined and cannot be used to concatenate file path components without additional assistance from the C implementation. So about all this allows you to do is some simple substitution that provides a complete path, such as:
#define MyPath "../../path/to/my/file.h" #include MyPath
Link to documentation. In particular this section doesn't leave much hope for portable solutions:
The method by which a sequence of preprocessing tokens between a
>preprocessing token pair or a pair of
"characters is combined into a single header name preprocessing token is implementation-defined.
For completeness, maybe something can be tried using http://stackoverflow.com/a/27830271/2436175. I'll investigate that when I have a moment...