我有一个文件包含在项目根目录中 - 比方说“root/libs/lib.h”。现在,这个文件本身包含了几个(实际上很多)文件。而且,它们都在另一个子目录中,可以说“root/libs/includes”。现在,我在写这个lib.h:重新定义包含路径C++
#include "includes/file1.c"
#include "includes/file2.c"
/*and so on*/
#include "includes/file20.c"
现在,那岂不是更方便,更灵活,如果我可以改变实际包含路径?
#set_include_path "includes";
#include "file1.c"
/* ... */
#include "file20.c"
#set_include_path ".."; //returning to original folder
我相信这是编译器相关的功能,所以对于回复,也要提到编译器。我自己使用G ++。
你问是否有编译器支持这个? –