Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/139.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何消除magick_alloc_size宏重新定义的警告_C++_Imagemagick_Magick++ - Fatal编程技术网

C++ 如何消除magick_alloc_size宏重新定义的警告

C++ 如何消除magick_alloc_size宏重新定义的警告,c++,imagemagick,magick++,C++,Imagemagick,Magick++,我在C++程序中使用MaGik++,我看到下面的警告信息: 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 includ

我在C++程序中使用MaGik++,我看到下面的警告信息:

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++中,而不是我的程序中


我在谷歌上搜索了一下这个警告,但没有找到任何明显的解决方案。你能给出编译命令行或makefile吗?我想您可能错过了Magic++-config。看起来您在wand中的method attribute.h头文件不正确。该文件中应该是wand_alloc_大小。@SHR我使用的是CMake,但本周我将尝试寻找一个不同的FindMagick++。