This may seem a little stupid:) But it\'s been bothering a while. When I include some header files which are written by others in my C++/C program, how does the compiler kno
As the others already explained, you need to tell your compiler where to look for the files. This implies that you should know which path to specify for your compiler.
Some components provide a mechanism where you don't need to know the exact path but can automatically retrieve it from your system.
For example if you want to compile using GTK+3 you need to specify these flags for your compiler:
CFLAGS:= -I./ `pkg-config --cflags gtk+-3.0`
LIBS:= -lm `pkg-config --libs gtk+-3.0`
This will automatically result in the required include and library path flags for GCC.