title: Include dlib in c++ project
body: <p>I'm trying to get the dlib library working in my c++ project and don't know what to do with my Makefile and the #include&lt;...> in the header file of my script. I have placed my header file and my script in the src directory. A symbolic link has been made to the dlib library, the link is in the include directory (see the folder structure below).</p>
  
  <p>On the dlib website it says:</p>
  
  <blockquote>
    <p>You should not add the dlib folder itself to your compiler's include path</p>
    
    <p>Instead you should add the folder that contains the dlib folder to your include search path and then use include statements of the form #include . This will ensure that everything builds correctly. </p>
  </blockquote>
  
  <p>The only thing I want is to include the dlib in my header file and make it compile so that I can use all the functions of dlib. Can you help me with this?</p>
  
  <p>The folder structure is like this:</p>
  
  <pre><code>    projectDir
      |-Makefile
      |-src
      | |-main.cpp
      | |-main.hpp
      |-include
        |-dlib (symbolic link)
          |-all
          |  |-source.cpp
          |- lots of header files
          |-...
  </code></pre>
  
  <p>The makefile looks like this:</p>
  
  <pre><code>    CC      := g++ # This is the main compiler
      # CC := clang --analyze # and comment out the linker last line for sanity
      SRCDIR  := src
      LIBDIR  := lib
      BUILDDIR:= build
      TARGET  := bin/main
  
      SRCEXT  := cpp
      SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
      OBJECTS := $(patsubst$(SRCDIR)/%,$(BUILDDIR)                                                        /%,$(SOURCES:.$(SRCEXT)=.o))
      CFLAGS  := -g # -Wall
      LIB     := $(shell find $(LIBDIR) -type f -name *.$(SRCEXT))
      INC     :=
  
      $(TARGET): $(OBJECTS)
          @echo " Linking..."
          $(CC) $^ -o $(TARGET) $(LIB)
  
      $(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
          @mkdir -p $(BUILDDIR)
          $(CC) $(CFLAGS) $(INC) -c -o $@ $&lt;
  
      clean:
          @echo " Cleaning..."; 
          $(RM) -r $(BUILDDIR) $(TARGET)
  
      .PHONY: clean
  </code></pre>
  
  <p>This is the main.cpp file:</p>
  
  <pre><code>    #include "main.hpp"
  
      int main(){
          return 0;
      }
  </code></pre>
  
  <p>And the header file: main.hpp, is empty since I really don't know what to do with it.</p>