Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am installing imagick-v3.1.0RC2 package on CentOS 5.5. I have ImageMagick 6.7.9-9 installed as well and have a problem on the make step.

Problem is that its cannot find included file:

/usr/local/include/ImageMagick/wand/magick/accelerate.h:25:31: error: magick/morphology.h: No such file or directory

If I copy folder magick over into /usr/local/include/ImageMagick/wand/magick/magick then it will find it but will say some other file is missing in magic/xxx.h so I have to copy magick again and again there should be some way around?

I created a symlink in /ImageMagick/wand/magick ln -s ../magick magick however it still has the same problem inside file accelerate.h on line 25 it has #include <magick/random_.h>

I also tried to do

make --include-dir=/usr/local/include/ImageMagick/ --include-dir=/usr/local/include/ImageMagick` and `make -I /usr/local/include/ImageMagick/ -I /usr/local/include/ImageMagick

I ended up running make -n to show all commands that make will execute and then added -I /usr/local/include/ImageMagick/ -I /usr/local/include/ImageMagick to them and run one by one manually.

Isn't there faster way?


The trick was to find where file is with find / --name "missing.file" and then add the symlinks in the folder where I run Make i.e. /usr/src/imagick-v3.1.0RC2/

ln -s usr/local/include/ImageMagick/magick magick


ln -s usr/local/include/ImageMagick/wand wand
share|improve this question

closed as off-topic by Braiam, slm Oct 27 '14 at 19:37

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Braiam, slm
If this question can be reworded to fit the rules in the help center, please edit the question.

try adding -I until the wand directory like -I/usr/local/include/ImageMagick/wand or -I/usr/local/include/ImageMagick/wand/magick

share|improve this answer
its the same error – John Smith Oct 2 '12 at 22:12

I'm sorry, but you seem to misunderstand make completely. I'll assume we're talking about GNU make for this answer, although some people seem to outright deny the existence of alternative flavors.

What you achieve with these two lines:

make --include-dir=/usr/local/include/ImageMagick/ --include-dir=/usr/local/include/ImageMagick
make -I /usr/local/include/ImageMagick/ -I /usr/local/include/ImageMagick

is that you pass these parameters to make. Well, that's legal and all, but it gives the includes to be included into the Makefile/GNUmakefile, not the includes used by any compiler called by the make process.

In order to achieve that, the best is to run it as:

make -npf /dev/null

(pipe into less or so)

to get a feel for the default rules. Assuming you want the C or C++ compiler to find these files and assuming the make process uses the default rules and/or conventions, you should be able to set one of the following variables:

  • CPPFLAGS (C preprocessor flags)
  • CFLAGS (C compiler flags)
  • CXXFLAGS (C++ compiler flags)

To see the exact details for your make file check out

make -np
# or ...
make -npf Makefile

in case default rules are re-defined.

Depending on the internals of the make process this will help to point the compiler to the right place. For example if GCC is used for compilation and linking CPPFLAGS should work fine. In you example you'd want to invoke make thus as:

make CPPFLAGS="-I /usr/local/include/ImageMagick/ -I /usr/local/include/ImageMagick"

assuming you don't just want to use the default target, but a target named install you'd do:

make CPPFLAGS="-I /usr/local/include/ImageMagick/ -I /usr/local/include/ImageMagick" install

... and another alternative is to pass the variable as environment variable to make instead of passing it on the command line:

CPPFLAGS="-I /usr/local/include/ImageMagick/ -I /usr/local/include/ImageMagick" make

... in a similar fashion you can set defines (-DNAMEOFDEFINE=VALUE).

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.