Error C1021: invalid preprocessor command 'warning'

I tried to configurate project to use ImageMagick library as described here

and I got the error C1021: invalid preprocessor command 'warning'

any idea what could this mean?

# warning "you should set MAGICKCORE_QUANTUM_DEPTH to sensible default set it to configure time default"
# warning "this is an obsolete behavior please fix your makefile"

I did not write the code, this is in the magick-config.h
Your compiler doesn't recognize #warning as a valid preprocessor command.

You could try a couple of things:
1) Define MAGICKCORE_QUANTUM_DEPTH. That should cause the compiler to skip lines 2 and 3.
2) You could try changing #warning to #error #error is probably more widely recognized by compilers.
I have followed this advice:
helped me to solve the problem, but I have many different errors now. Looks like some files are not included...

I got this errors
does it indicate missing file or incorrect version of C++? I use C++03
Last edited on
┬┐what compiler are you using?
I think that that project is using gcc extensions
Ah, yes. I remember, they told it somewhere in reference. So I need to get the gcc extensions for windows. I am using Visual Studio Express.

In the "how to build" section they have:
Cygwin & GCC

It is possible to build both ImageMagick and Magick++ under the Cygwin Unix-emulation environment for Windows NT. Obtain and install Cgywin from . An X11R6 environment for Cygwin is available from
Last edited on
Registered users can post here. Sign in or register to post.