here is some (probably) very simple problem: I'm trying to use the perceptual hashing library pHash with Ubuntu 11.10. I already had ffmpeg installed, by the way this is what I've done:
sudo apt-get install libphash0
sudo apt-get install libphash0-dev
Then tried to compile this program:
#include <iostream>
#include <pHash.h>
using namespace std;
int main()
{
ulong64 myhash=0;
ph_dct_imagehash("test.jpg", myhash);
cout<<myhash<<endl;
}
When compiling, it just prints out:
undefined reference to `ph_dct_imagehash'
Any suggestion? What should I do? Thanks in advance!
Matteo Monti
You didn't link to the library. Headers contain definition of library contents. Actual implementation is in library itself. You may link to it either statically or dynamically.
If you're using make, add your library path to makefile and recompile:
If library is installed in system, it's probably in one of known paths. (/usr/lib/ or ...). So try adding:
Note: make system interprets
-lname
as<path>/libname.so
. Not always true, but its like almost that.