Error with Magick++: "Magick++.h file not found

641 Views Asked by At

I am new to Magick++, and today when I tried to set it up to deal with a C++ project. I set up ImageMagick with homebrew, and then I tried to compile my file using the command similar to what I found in the documentation:

c++ -O2 -o ascii ascii.cpp `Magick++-config --cppflags --cxxflags --ldflags --libs

But I got some error. And actually, when I consulted the documentation https://imagemagick.org/Magick++/Install.html regarding the installation of Magick++, I got a little bit confused --- I did not find any useful instruction in the "README.txt" as suggested on the web page. Can anyone help me out about it?

The output I got was:

/usr/local/bin/Magick++-config: line 47: /usr/local/opt/pkg-config/bin/pkg-config: No such file or directory
/usr/local/bin/Magick++-config: line 53: /usr/local/opt/pkg-config/bin/pkg-config: No such file or directory
/usr/local/bin/Magick++-config: line 56: /usr/local/opt/pkg-config/bin/pkg-config: No such file or directory
ascii.cpp:1:10: fatal error: 'Magick++.h' file not found
#include <Magick++.h>
         ^~~~~~~~~~~~
1 error generated. 

1

There are 1 best solutions below

0
On

Did you install 6.9 or the latest version 7.1? Trying other might help. Similar to this you can do try to search for Magick++ header file and see whats missing. But yes, you need to do brew install pkg-config first like Mark mentioned above.