[Pkg-gmagick-im-team] Magick++ ABI problem with GCC 7
Jeroen Ooms
jeroen at berkeley.edu
Sat Sep 2 10:11:41 UTC 2017
I am unable to link my applications to ImageMagick++ when it is
compiled with gcc-7 due to an incompatibility in the `std::string()`
coercion of the `Magick::Color` class.
Below a minimal example:
#include <Magick++.h>
#include <iostream>
int main(){
Magick::Image image("logo:");
Magick::Color col(image.fillColor());
std::string strcol(col);
std::cout << strcol;
return 0;
}
The program builds fine with g++6 but with g++7 I get a linking error:
g++-6 test.cpp $(pkg-config --cflags --libs Magick++)
./a.out
> #000000000000
However with gcc 7 we get:
g++-7 test.cpp $(pkg-config --cflags --libs Magick++)
/tmp/cchhBIuN.o: In function `main':
test.cpp:(.text+0x7f): undefined reference to
`Magick::Color::operator std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >() const'
collect2: error: ld returned 1 exit status
Problem was also reported upstream but they say it's a compiler
problem: https://github.com/ImageMagick/ImageMagick/issues/707
More information about the Pkg-gmagick-im-team
mailing list