Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有任何编译器标志(或其他方法)不允许包括如下
#include "../lib.h"
但仍然允许您在当前上下文及其子项中包含库
#include "lib.h" #include "directory/lib.h"
没有这样的标志可以传递来执行此操作。
我怀疑有人可以在编译器调用中对其他程序进行一些调用,但这开始成为维护的噩梦。
相反,应该查看项目所使用的构建系统提供的功能,看看它是否提供了可以在编译之前运行的任何形式的检查。