peter green - 2020-08-28

Contary to the title I don't belive this is related to g++-10, I was able to reproduce it with g++-9

The issue is that Magick++.h (indirectly) includes assert.h inside a namespace.

Note that generally only the first include of a header actually does anything due to the presense of include gaurds.
Therefore if assert.h is included before Magick++.h then everything is fine, the symbols from assert.h are correctly
included in the global namespace. OTOH if the first include of assert.h is the one from Magick++.h then the symbols
from assert.h are defined in the MagickCore namespace which breaks stuff.

I would argue that is a bug in imagemagick and have filed bugs in both Debian and upstream as
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=969128 and https://github.com/ImageMagick/ImageMagick6/issues/95

Nevertheless this can be worked around fairly easily in pfstools by re-ordering the includes so that pfs.h
(which includes assert.h) is included before Magick++.h . I have done so in Raspbian bullseye-staging

A patch doing so can be found at
https://github.com/raspbian-packages/pfstools/blob/bullseye-staging/debian/patches/reorder-includes-imagemagick.patch