3

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)

Hyperion
  • 2,515
  • 11
  • 37
  • 59
  • You could install the `pkgconfig` port. Since `pHash` appears to install a `pHash.pc` file, you can find include paths with `pkg-config --cflags pHash` (or `--cflags-only-I`). There are similar options to query the libraries to link with, and their paths. – Brett Hale Jun 04 '15 at 03:02

1 Answers1

5

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...

trojanfoe
  • 120,358
  • 21
  • 212
  • 242