Introduction to GCC has an example:
$ gcc -Wall -L. main.c -lhello -o helloThe option ‘-L.’ is needed to add the current directory to the library search path.
Does it mean that the current directory is not a default search path for static library files, so needs to be added to the library search path by -L.?
Similar question for dynamic library file search. Is the current directory is a default search path for dynamic library files, or do we need to add the current directory to the dynamic library search paths by --rpath .?
Similar question for header file search. Is the current directory is a default search path for header files , or do we need to add the current directory to the header search paths by -I.?
Does the following example imply that the current directory is a default search path for header files , and we don't need to add the current directory to the header search paths by -I.?
$ ls main.c hello.h
hello.h main.c
$ cat main.c
#include "hello.h"
int
main (void)
{
hello ("world");
return 0;
}
$ gcc -c main.c
$