cflags problem

Tollef Fog Heen tfheen at
Wed Oct 19 06:34:29 PDT 2005

* ac 

| when a package is installed at `/usr/local', which is the default
| install location for packages using GNU autotool to configure
| themselves,
| later `pkg-config --cflags pkgname' will output something like
| `-I/usr/local/include',
| but since `/usr/local/include' is searched by gcc as one standard
| system header directory, `-I/usr/local/include' actually do nothing, 
| and is ignored by gcc,


| this behavior may cause problem , especially used with
| `-I/usr/X11R6/include' , which is not searched by default by gcc.
| if gcc is passed options like `-I/usr/local/include -I/usr/X11R6/include',
| one would expect that gcc will search `/usr/local/include first',
| but that wont happen, coz ```-I/usr/local/include' does nothing'' ,
| said Pinskia( gcc developer ) and gcc manual.

Why is this a problem?  Do you have overlapping header files between
/usr/include (or /usr/local/include) and other places?

If so, the solution is «don't have that» or pass flags to make cpp not
look in the standard directories.

Tollef Fog Heen                                                        ,''`.
UNIX is user friendly, it's just picky about who its friends are      : :' :
                                                                      `. `' 

More information about the pkg-config mailing list