Code:
Terry@dixie$ gcc -v -E - 15:26
Using built-in specs.
Target: i386-undermydesk-freebsd
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719 [FreeBSD]
/usr/libexec/cc1 -E -quiet -v -D_LONGLONG - -std=c99 -Wall -W -Wpointer-arith -Wbad-function-cast
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include
End of search list.
^C
Terry@dixie$ 15:27
Why *should* the system compiler search anything but the system headers and libraries by default ?
Like most decent compilers and some indecent ones gcc can be told to append items to it's search paths.
Code:
gcc -I/usr/local/include -L/usr/local/lib -lX11 xlib_test.c -o test
If I want to use a third party library without explicitly telling the compiler where to find your files set the LIBRARY_PATH and (LANG)_INCLUDE_PATH environment variables as stated in the gcc manual.
where (LANG) is C, CPLUS, OBJC, and so on.
NOTE:
ensuring the correctness and secure implementation of third party libraries is not a core concern of the FreeBSD project when compared to system libraries.