title: Makefile - No such file or directory of file.h ( Can't find the solution)
body: <p>I was trying to make a Makefile so I can develop my code a bit faster. My Makefile is the following:</p>
  <pre><code>IDIR =../include
  
  CXX=g++
  
  CXXFLAGS=-I$(IDIR)
  
  LDIR =../lib
  
  LIBS=-lm
  
  _DEPS = person.h
  
  DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
  
  OBJ = main/main.o ../modules/person.o  
  
  $(ODIR)/%.o: %.c $(DEPS)
  
      $(CXX) -c -o $@ $&lt; $(CXXFLAGS)
  
  run: $(OBJ)
  
      $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
  
  .PHONY: clean
  
  clean:
  
      rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~ 
  </code></pre>
  <p>But the problem is that the terminal outputs the following message:</p>
  <pre><code>g++ -I./include   -c -o main/main.o modules/main.cpp
  main/main.cpp:6:10: fatal error: person.h: No such file or directory
      6 | #include &lt;person.h&gt;
        |          ^~~~~~~~~~
  compilation terminated.
  make: *** [&lt;builtin&gt;: main/main.o] Error 1
  </code></pre>
  <p>My folder in which <code>person.h</code> is at <code>../include</code> but for some reason, my compiler does not find it. I am using Linux and not Windows.
  If I use the command:<code>$cpp -I../include/ -v</code> so to see if there is a problem at finding my folder but the output says the following:</p>
  <pre><code>Using built-in specs.
  COLLECT_GCC=cpp
  OFFLOAD_TARGET_NAMES=nvptx-none:hsa
  OFFLOAD_TARGET_DEFAULT=1
  Target: x86_64-linux-gnu
  Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
  Thread model: posix
  gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) 
  COLLECT_GCC_OPTIONS='-E' '-I' '../include/' '-v' '-mtune=generic' '-march=x86-64'
  /usr/lib/gcc/x86_64-linux-gnu/9/cc1 -E -quiet -v -I ../include/ -imultiarch x86_64-linux-gnu - -mtune=generic -march=x86-64 -fasynchronous-unwind-tables -fstack-protector-strong -Wformat Wformat-security -fstack-clash-protection -fcf-protection
  ignoring nonexistent directory &quot;/usr/local/include/x86_64-linux-gnu&quot;
  ignoring nonexistent directory &quot;/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed&quot;
  ignoring nonexistent directory &quot;/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-
  gnu/include&quot;
  ignoring nonexistent directory &quot;../include/&quot;
  #include &quot;...&quot; search starts here:
  #include &lt;...&gt; search starts here:
  /usr/lib/gcc/x86_64-linux-gnu/9/include
  /usr/local/include
  /usr/include/x86_64-linux-gnu
  /usr/include
  End of search list.
  </code></pre>
  <p>In which it says <strong>ignoring nonexistent directory <code>&quot;../include/&quot;</code></strong>. I believe that this is the problem but I can't find the solution to my problem.</p>
  <p>Thanks in advance.</p>
  <p>(If I put all the path from user to include, I have the same problem)</p>
  <p>EDIT:
  I made a file for my main and put my main.cpp in there and changed CXXLAGS to CXXFLAGS after seeing my mistakes in the comments and the answer.</p>
  <p>EDIT2:
  For some reason, it worked when I renamed the folder that had my include files.</p>