Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running make fails when building examples/test_dctvideohash.cpp #13

Closed
chalford opened this issue Nov 29, 2019 · 1 comment
Closed

Running make fails when building examples/test_dctvideohash.cpp #13

chalford opened this issue Nov 29, 2019 · 1 comment

Comments

@chalford
Copy link

I used ccmake to configure the Makefiles, setting WITH_VIDEO_HASH to ON. Subsequently building with make, the process throws an error when trying to build examples/test_dctvideohash.cpp.

Error details

/path/to/phash/examples/test_dctvideohash.cpp:44:25: error: use of undeclared identifier
      'ph_dct_videohash'; did you mean 'ph_dct_imagehash'?
        hashes[i - 1] = ph_dct_videohash(argv[i], lengths[i - 1]);
                        ^~~~~~~~~~~~~~~~
                        ph_dct_imagehash
/usr/local/include/pHash.h:229:5: note: 'ph_dct_imagehash' declared here
int ph_dct_imagehash(const char* file,ulong64 &hash);
    ^

Workaround

Looking in pHash.h, I can see #ifdef conditionally wrapping the signature for ph_dct_videohash. I used make -n to find the c++ command that was being used to compile the file that was throwing an error. I added -D HAVE_VIDEO_HASH=1 to that command, and ran it, which successfully compiled. I then continued to run make and make install which completed successfully.

I'm not sure if the problem here is my configuration, my environment (Mac OS 10.14), or something else.

@chalford chalford changed the title Running make fails when building examples/test_dctvideohash.cpp Running make fails when building examples/test_dctvideohash.cpp Nov 29, 2019
@eklinger
Copy link
Collaborator

Proper way to build is:
cmake -DWITH_AUDIO_HASH=1 -DWITH_VIDEO_HASH=1 ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants