C++ 是什么导致了g++;忽略不存在的目录

C++ 是什么导致了g++;忽略不存在的目录,c++,linux,compiler-errors,g++,C++,Linux,Compiler Errors,G++,我正在学习使用make。我正在尝试在我的家用机器上使用g++编译一个程序,我已经在学校机器上使用xl成功编译了这个程序。我正在尝试链接一个我构建的外部库,并将其放在一个单独的目录中。我试图包含头文件,但g++声称包含目录不存在。include目录肯定存在,tabcomplete将其填充,并且find也会找到它 为什么g++决定目录不存在?通常是什么导致目录被忽略?我想知道为什么会出现这种情况,以便更好地编写makefile。对我来说更重要的是,我如何解决这个问题,并让g++在我告诉它要查找的任何

我正在学习使用make。我正在尝试在我的家用机器上使用g++编译一个程序,我已经在学校机器上使用xl成功编译了这个程序。我正在尝试链接一个我构建的外部库,并将其放在一个单独的目录中。我试图包含头文件,但g++声称包含目录不存在。include目录肯定存在,tabcomplete将其填充,并且
find
也会找到它

为什么g++决定目录不存在?通常是什么导致目录被忽略?我想知道为什么会出现这种情况,以便更好地编写makefile。对我来说更重要的是,我如何解决这个问题,并让g++在我告诉它要查找的任何目录中搜索任意头文件

我见过关于g++忽略目录的问题,但这些问题都是在忽略各种系统默认位置的情况下出现的。他们通常通过删除冲突版本或重新安装工具来解决问题。我的问题不同,因为g++忽略了一个实际存在的用户定义目录

src/a3.cc:1:17: fatal error: apf.h: No such file or directory
#include "apf.h"

$ find /home/USER/Documents/GitHub/core/apf/
/home/USER/Documents/GitHub/core/apf/
/home/USER/Documents/GitHub/core/apf/apfUserData.cc
 ....
/home/USER/Documents/GitHub/core/apf/apf.h

....
我已尝试使用
-I

apf = /home/USER/Documents/Github/core/apf/
CFLAGS = $(CFLAGS) -Wall -g -I $(apf) --pedantic-errors --verbose
我还尝试设置CPLUS\u INCLUDE\u路径

export CPLUS_INCLUDE_PATH = $(apf)
对于这些尝试中的每一次,我都看到了相同的错误,即g++正在“忽略不存在的目录”

COLLECT\u GCC=/usr/bin/g++
GGC启发式:--param GGC min expand=100--param GGC min heapsize=131072
忽略不存在的目录“/home/USER/Documents/Github/core/apf/”
忽略不存在的目录“/usr/lib/gcc/x86_64-redhat-linux/4.9.2/include-fixed”
忽略不存在的目录“/usr/lib/gcc/x86\u 64-redhat-linux/4.9.2/../../../../../../x86\u 64-redhat-linux/include”
忽略重复目录“/usr/local/include”
因为它是与系统目录重复的非系统目录
#包括“…”搜索从这里开始:
#包括搜索从这里开始:
/公司
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../../../../../include/c++/4.9.2
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../../../../../include/c++/4.9.2/x86_64-redhat-linux
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../../../../../include/c++/4.9.2/backward
/usr/lib/gcc/x86_64-redhat-linux/4.9.2/include
/usr/本地/包括
/usr/包括
搜索列表结束。
GNU C++(GCC)4.4.2 20150212版(红帽4.92-6)(X86Y64-READHAT-Linux)
由GNU C版本4.9.2 20150212(Red Hat 4.9.2-6)、GMP版本6.0.0、MPFR版本3.1.2、MPC版本1.0.2编制
GGC启发式:--param GGC min expand=100--param GGC min heapsize=131072
编译器可执行校验和:954ba53e83b294b646fa1b6b73a69682

您似乎有一个区分大小写的文件系统。有些地方有
GitHub
,有些地方有
GitHub
。让它们正确匹配,你的身体就会更好。

就是这样!现在我觉得问这个有点不好。
COLLECT_GCC=/usr/bin/g++

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/USER/Documents/Github/core/apf/"

ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.9.2/include-fixed"
 ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../x86_64-redhat-linux/include"
ignoring duplicate directory "/usr/local/include"
  as it is a non-system directory that duplicates a system directory
 #include "..." search starts here:
 #include <...> search starts here:
 ./inc
 /usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2
 /usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/backward
 /usr/lib/gcc/x86_64-redhat-linux/4.9.2/include
 /usr/local/include
 /usr/include
End of search list.
GNU C++ (GCC) version 4.9.2 20150212 (Red Hat 4.9.2-6) (x86_64-redhat-linux)
    compiled by GNU C version 4.9.2 20150212 (Red Hat 4.9.2-6), GMP version 6.0.0, MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 954ba53e83b294b646fa1b6b73a69682