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?

1

6 Answers 6

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

Sign up to request clarification or add additional context in comments.

Comments

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>

Comments

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 

4 Comments

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
@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.
@Mr.32: As cnicutar has pointed out you need to use pkg-config. For gstreamer it is not just gstreamer, it is gstreamer-<version>. 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?
in tcsh export is not there but i have solved problem by setting gstreamer path using "setenv"
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.

Comments

3
`gcc -print-prog-name=cc1` --verbose 

and then CTRL+C

2 Comments

You could improve your answer by adding a short description what this command does and how it helps with the question.
I agree with @dakab, you should explain how this helps the OP
2

you can find those files in:

/usr/include 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.