How do I add a directory to C header include path?

Use -I /opt/local/include on the command line or C_INCLUDE_PATH=/opt/local/include in the environment.


Use the pcre-config utility to get the right flags:

$ pcre-config --libs --cflags
-L/opt/local/lib -lpcre
-I/opt/local/include

If you're compiling via the command line,

$ gcc -Wall -g `pcre-config --libs --cflags` main.c