Custom Sub-Includes??? (Like <gtk/window.h>)

Oct 5, 2009 at 6:39pm
Ive noticed in tutorials and such, people only including bits of a library. Like #include <gtk/window.h> instead of just #include <gtk>. Is this special to the <> type of include or are they just in a directory? and if so can I make whole directories include the same way?
Oct 5, 2009 at 6:41pm
great question. Cant wait for some one else to answer it.
Oct 5, 2009 at 6:44pm
#include <something.h>
makes the preprocessor looking for 'something.h' only in its include directories.
#include "something.h"
makes it also look in the current directory
#include <path/something.h>
means that 'path' is a subdirectory of the include directories.

#include
can include only files, not directories.
Oct 5, 2009 at 6:50pm
Is there any way to include directories?
Oct 5, 2009 at 7:08pm
Ahh right ok. Would this work, it seems to be set out that way in some of my usr/include directories.

Folders:
1
2
3
4
5
6
7
Root/
  MyInc/
   something.h
   foo.h
   bar.h
  MyInc.h // Includes all in the folder
  main.cpp


1
2
3
4
5
// To Include All
#include "MyInc.h"

// To Include One (MyInc.h Lines)
#include "MyInc/foo.h" 
Topic archived. No new replies allowed.