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

Unable to create .pylib file with Mac Sonoma. #41

Open
ChurikiTenna opened this issue Mar 6, 2024 · 0 comments
Open

Unable to create .pylib file with Mac Sonoma. #41

ChurikiTenna opened this issue Mar 6, 2024 · 0 comments

Comments

@ChurikiTenna
Copy link

ChurikiTenna commented Mar 6, 2024

I want to compile the library into .dylib file in Mac.
However, cmake --build . fails with 'png.h' file not found error.

git clone https://github.com/aetilius/pHash.git
brew install libpng jpeg ffmpeg
mkdir build    
cd build
cmake ../pHash    
cmake --build .

[ 50%] Building CXX object CMakeFiles/pHash.dir/src/pHash.cpp.o
In file included from /Users/tenna/pHash/src/pHash.cpp:25:
In file included from /Users/tenna/pHash/src/pHash.h:60:
/Users/tenna/pHash/third-party/CImg/CImg.h:470:10: fatal error: 'png.h' file not found
#include "png.h"
         ^~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/pHash.dir/src/pHash.cpp.o] Error 1
make[1]: *** [CMakeFiles/pHash.dir/all] Error 2
make: *** [all] Error 2

libpng is already installed.

% brew install libpng            
Warning: libpng 1.6.43 is already installed and up-to-date.

but the png.h location was not in the default /usr/local/include, so I added this to CMakeLists.txt

include_directories("/Library/Frameworks/Mono.framework/Versions/6.12.0/include")

Then, I tried
% cmake ../pHash
% cmake --build .
which produced this error:


[ 50%] Building CXX object CMakeFiles/pHash.dir/src/pHash.cpp.o
In file included from /Users/tenna/pHash/src/pHash.cpp:25:
In file included from /Users/tenna/pHash/src/pHash.h:60:
/Users/tenna/pHash/third-party/CImg/CImg.h:2894:29: warning: 'vsprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead. [-Wdeprecated-declarations]
    const int result = std::vsprintf(s, format, args);
                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/stdio.h:199:1: note: 'vsprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
make[2]: *** No rule to make target `/opt/homebrew/lib/libmpg123.dylib', needed by `Release/libpHash.1.0.0.dylib'.  Stop.
make[1]: *** [CMakeFiles/pHash.dir/all] Error 2
make: *** [all] Error 2

then I tried to create phash.dylib from pHash.cpp like this.
% g++ -dynamiclib -o phash.dylib pHash.cpp
It fails with this error:

In file included from pHash.cpp:25:
./pHash.h:60:10: fatal error: 'CImg.h' file not found
#include "CImg.h"
         ^~~~~~~~
1 error generated.
@ChurikiTenna ChurikiTenna changed the title Unable to create .pylib file. Unable to create .dylib file. Mar 6, 2024
@ChurikiTenna ChurikiTenna changed the title Unable to create .dylib file. Unable to create .pylib file with Mac Sonoma. Mar 6, 2024
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

1 participant