c++macosmacportsphash

Can't locate libraries installed with MacPorts


I've installed pHash libraries using MacPorts but when I try to compile the example source code I get this error:

Fatal error: 'pHash.h' file not found
#include "pHash.h"

How can I tell the source code where to find the libraries? (from what I found they are installed in /opt/local)


Solution

  • MacPorts installs stuff into /opt/local so those header files will be in /opt/local/include, which is a non-standard directory, as far as the compiler is concerned.

    You will need to pass -I/opt/local/include to the compiler. How you do that depends on your build system, however both make and Xcode support it.

    You will most likely need to pass -L/opt/local/lib to the linker too...