I have a set of includes that reside in a far off directory meaning that including them requires a long include, such as:
#include "../../Path/to/my/file.h"
Where I have multiple of these it becomes a bit inconvenient so I am thinking I may be able to use a #define for the directory path and then concat the file name that I need, i.e.
#define DIR "../../Path/to/my/"
#define FILE1 "file.h"
#define FILE2 "anotherFile.h"
#include DIR FILE1 // should end up same as line in first example after pre-proc
However this does not work... is there anyway to concatenate within the workings of the C pre-processor suitable for this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…