包含路径中具有相同名称的两个标头

Poo*_*rna 2 makefile

在我的make文件中的CINCLUDE路径中,有两个具有相同名称的标头.

我无法删除其中一个.如何指示makefile优先处理特定文件夹中的头文件.

pax*_*blo 6

这通常是编译器指定的内容.例如,使用gcc,您可以创建以下文件:

qq.c:
    #include <qq.h>
    int main (void) {
        return 0;
    }
1/qq.h:
    #error file number 1
2/qq.h:
    #error file number 2
Run Code Online (Sandbox Code Playgroud)

然后,当你编译它们时:

pax> gcc -I1 -I2 -o qq qq.c
In file included from qq.c:1:
1/qq.h:1:2: #error file number 1

pax> gcc -I2 -I1 -o qq qq.c
In file included from qq.c:1:
2/qq.h:1:2: #error file number 2
Run Code Online (Sandbox Code Playgroud)

换句话说,它是指定包含路径的顺序(with -I),它决定了搜索的顺序(还有其他的东西,比如标题是否与系统标题相同,但它们在这里不需要关注我们).