8

see if i write in any c file like

#include "header.h"

then it will search this file in current directory

but when i write

#include <header.h>

then where it will go to find this file ? what is defualt path for header file included in c program?

see i have installed gstreamer in /usr/local but when i am including

#include <gst/gst.h>

i am geeting fatal error: gst/gst.h: No such file or directory

How can i remove this error?

mouviciel
  • 66,855
  • 13
  • 106
  • 140
Jeegar Patel
  • 26,264
  • 51
  • 149
  • 222
  • 2
    You can see the answer [here]. [here]: http://stackoverflow.com/questions/1217943/where-are-include-files-stored-ubuntu-linux-gcc –  Oct 20 '11 at 10:04

6 Answers6

21

Try running gcc -v -E -. When I do, part of the output is as follows:

#include <...> search starts here:
 /usr/lib/gcc/i686-linux-gnu/4.6.1/include
 /usr/local/include
 /usr/lib/gcc/i686-linux-gnu/4.6.1/include-fixed
 /usr/include/i386-linux-gnu
 /usr/include

It's not an answer to the gstreamer question, but I hope this still helps!

Pulled from here

Nate
  • 12,499
  • 5
  • 45
  • 60
6

The default paths are

/usr/local/include
/usr/include

If you use another path, you can add in your compile command with -I flag. In your case, assuming you have a /usr/local/gst/include directory, you may add -I/usr/local/gst/include and use #include <whatever_you_need.h>

Tio Pepe
  • 3,071
  • 1
  • 17
  • 22
5

The path searched depends on the implementation (and current configuration). The correct way to find the include path is to use pkg-config

pkg-config --cflags gstreamer
cnicutar
  • 178,505
  • 25
  • 365
  • 392
  • it shows this error --> Package gstreamer was not found in the pkg-config search path. Perhaps you should add the directory containing `gstreamer.pc' to the PKG_CONFIG_PATH environment variable No package 'gstreamer' found – Jeegar Patel Oct 20 '11 at 10:01
  • @Mr.32 Perhaps you need to specify a version. Or maybe `gstreamer` isn't correctly installed. Look in `/usr/lib/pkgconfig` and `/usr/share/pkgconfig`. – cnicutar Oct 20 '11 at 10:02
  • 1
    @Mr.32: As cnicutar has pointed out you need to use pkg-config. For gstreamer it is not just gstreamer, it is gstreamer-. As you have installed gstreamer in /usr/local check the output of `ls /usr/local/lib/pkgconfig/gstreamer*`, you should find a bunch of .pc files. Now try this: `export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig` then `pkg-config --cflags gstreamer-0.10` assuming you found `gstreamer-0.10.pc` in `ls` command. Does that show any output? – another.anon.coward Oct 20 '11 at 10:55
  • in tcsh export is not there but i have solved problem by setting gstreamer path using "setenv" – Jeegar Patel Oct 20 '11 at 11:31
4

The default path for <> stuff is /usr/include, at least on Unix.

You can add as many default paths as you want with -I /my/new/path compiler option.

mouviciel
  • 66,855
  • 13
  • 106
  • 140
3
`gcc -print-prog-name=cc1` --verbose

and then CTRL+C

John Doe
  • 373
  • 3
  • 4
2

you can find those files in:

/usr/include
chown
  • 51,908
  • 16
  • 134
  • 170
0xd
  • 1,891
  • 12
  • 18