我在C ++程序中使用Magick ++,我看到以下警告信息:
In file included from /Users/jwoods/Projects/glidar/src/main.cpp:40:
In file included from /Users/jwoods/Projects/glidar/src/scene.h:37:
In file included from /usr/local/include/ImageMagick-6/Magick++.h:9:
In file included from /usr/local/include/ImageMagick-6/Magick++/Include.h:42:
In file included from /usr/local/include/ImageMagick-6/wand/MagickWand.h:71:
/usr/local/include/ImageMagick-6/wand/method-attribute.h:120:11: warning: 'magick_alloc_size' macro redefined
# define magick_alloc_size(x) __attribute__((__alloc_size__(x)))
^
/usr/local/include/ImageMagick-6/magick/method-attribute.h:132:11: note: previous definition is here
# define magick_alloc_size(x) /* nothing */
^
In file included from /Users/jwoods/Projects/glidar/src/main.cpp:40:
In file included from /Users/jwoods/Projects/glidar/src/scene.h:37:
In file included from /usr/local/include/ImageMagick-6/Magick++.h:9:
In file included from /usr/local/include/ImageMagick-6/Magick++/Include.h:42:
In file included from /usr/local/include/ImageMagick-6/wand/MagickWand.h:71:
/usr/local/include/ImageMagick-6/wand/method-attribute.h:121:11: warning: 'magick_alloc_sizes' macro redefined
# define magick_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y)))
^
/usr/local/include/ImageMagick-6/magick/method-attribute.h:133:11: note: previous definition is here
# define magick_alloc_sizes(x,y) /* nothing */
2 warnings generated.
我将Magick ++包含在我认为是头文件的正常方式中,
#ifndef MY_HEADER_H
# define MY_HEADER_H
# include <Magick++.h>
#endif
所以我认为问题出在Magick ++中,而不是我的程序。
我在谷歌搜索了一下这个警告,但没有找到任何明显的解决方法来摆脱它。