title: Error in include path?
body: <p>I try to compile a program. But I think it don't work cause the include path is not right.</p>
  
  <p>I use the power-linux-gcc from the ELDK.</p>
  
  <p>The file structure is like this</p>
  
  <pre><code>linux-kernel ----- driver----graphic_test----- Makefile
                 |                          |
                 |                          | -- main.c
                 |
                  --  include--linux --- jiffies.h
                                      |
                                        -- semaphore.h   
  </code></pre>
  
  <p>This is the way I include them in the semLib.c file </p>
  
  <pre><code>#include &lt;jiffies.h&gt;
  #include &lt;semaphore.h&gt; 
  </code></pre>
  
  <p>I also tried </p>
  
  <pre><code>#include &lt;linux/jiffies.h&gt;
  #include &lt;linux/semaphore.h&gt;     
  </code></pre>
  
  <p>I'm not quite sure if the problem is the include, but I think.</p>
  
  <p>That is my Makefile:</p>
  
  <pre><code>CC=powerpc-linux-gcc
  
  LIBS = ../../kernel/time/jiffies.o ../../kernel/semaphore.o #libdrmko.o libdrm.o libs3gko.o
  
  INC =   -I../../include
  
  C_SRC = main.c lstLib.c  systLib.c semLib.c    #taskLib.c
  
  C_OBJ = main.o lstLib.o systLib.o semLib.o    # taskLib.o
  
  graphics_test: $(LIBS) $(C_OBJ)
      $(CC) -o graphics_test $(LIBS) $(C_OBJ) $(INC)
  </code></pre>
  
  <p>That is the message from <code>make</code></p>
  
  <pre><code>:~/Linux_Development_Workspace/linux-kernel/drivers/graphic_test$ make
  powerpc-linux-gcc    -c -o ../../kernel/semaphore.o ../../kernel/semaphore.c
  ../../kernel/semaphore.c:28:28: error: linux/compiler.h: No such file or directory
  ../../kernel/semaphore.c:30:26: error: linux/module.h: No such file or directory
  ../../kernel/semaphore.c:32:29: error: linux/semaphore.h: No such file or directory
  ../../kernel/semaphore.c:33:28: error: linux/spinlock.h: No such file or directory
  ../../kernel/semaphore.c:34:26: error: linux/ftrace.h: No such file or directory
  ../../kernel/semaphore.c:36: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
  ../../kernel/semaphore.c:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
  ../../kernel/semaphore.c:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
  ../../kernel/semaphore.c:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
  ../../kernel/semaphore.c:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
  ../../kernel/semaphore.c:53: warning: 'struct semaphore' declared inside parameter list
  ../../kernel/semaphore.c:53: warning: its scope is only this definition or declaration, which is probably not what you want
  ../../kernel/semaphore.c: In function 'down':
  ../../kernel/semaphore.c:57: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:58: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:59: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:62: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c: At top level:
  ../../kernel/semaphore.c:64: warning: data definition has no type or storage class
  ../../kernel/semaphore.c:64: warning: parameter names (without types) in function declaration
  ../../kernel/semaphore.c:75: warning: 'struct semaphore' declared inside parameter list
  ../../kernel/semaphore.c: In function 'down_interruptible':
  ../../kernel/semaphore.c:80: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:81: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:82: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:85: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c: At top level:
  ../../kernel/semaphore.c:89: warning: data definition has no type or storage class
  ../../kernel/semaphore.c:89: warning: parameter names (without types) in function declaration
  ../../kernel/semaphore.c:101: warning: 'struct semaphore' declared inside parameter list
  ../../kernel/semaphore.c: In function 'down_killable':
  ../../kernel/semaphore.c:106: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:107: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:108: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:111: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c: At top level:
  ../../kernel/semaphore.c:115: warning: data definition has no type or storage class
  ../../kernel/semaphore.c:115: warning: parameter names (without types) in function declaration
  ../../kernel/semaphore.c:130: warning: 'struct semaphore' declared inside parameter list
  ../../kernel/semaphore.c: In function 'down_trylock':
  ../../kernel/semaphore.c:135: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:136: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:138: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:139: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c: At top level:
  ../../kernel/semaphore.c:143: warning: data definition has no type or storage class
  ../../kernel/semaphore.c:143: warning: parameter names (without types) in function declaration
  ../../kernel/semaphore.c:155: warning: 'struct semaphore' declared inside parameter list
  ../../kernel/semaphore.c: In function 'down_timeout':
  ../../kernel/semaphore.c:160: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:161: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:162: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:165: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c: At top level:
  ../../kernel/semaphore.c:169: warning: data definition has no type or storage class
  ../../kernel/semaphore.c:169: warning: parameter names (without types) in function declaration
  ../../kernel/semaphore.c:178: warning: 'struct semaphore' declared inside parameter list
  ../../kernel/semaphore.c: In function 'up':
  ../../kernel/semaphore.c:182: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:183: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:184: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c:187: error: dereferencing pointer to incomplete type
  ../../kernel/semaphore.c: At top level:
  ../../kernel/semaphore.c:189: warning: data definition has no type or storage class
  ../../kernel/semaphore.c:189: warning: parameter names (without types) in function declaration
  ../../kernel/semaphore.c:194: error: field 'list' has incomplete type
  ../../kernel/semaphore.c:204: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__down_common'
  ../../kernel/semaphore.c:236: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
  ../../kernel/semaphore.c:241: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
  ../../kernel/semaphore.c:246: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
  ../../kernel/semaphore.c:251: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
  ../../kernel/semaphore.c:256: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
  make: *** [../../kernel/semaphore.o] Fehler 1
  </code></pre>