Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABI problem with gcc-7 on Debian #707

Closed
jeroen opened this issue Aug 30, 2017 · 5 comments
Closed

ABI problem with gcc-7 on Debian #707

jeroen opened this issue Aug 30, 2017 · 5 comments
Labels

Comments

@jeroen
Copy link
Contributor

jeroen commented Aug 30, 2017

We've been having trouble building the R bindings on Debian "testing" (Buster). I have arrowed it down to the std::string() coercion of the Magick::Color class.

I am unsure if this is a bug in IM or Debian or me. I know that Debian ships a reasonable old version of IM6, but perhaps we can at least point down the issue so that I can properly understand and report it.

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
@mikayla-grace
Copy link

We had similar problems with gcc 7 under Fedora. A recent update to the compiler fixed the problem. We are compiling with g++ (GCC) 7.1.1 20170622 and your test.cpp source compiles without complaint.

@jeroen
Copy link
Contributor Author

jeroen commented Aug 30, 2017

Debian is running 7.2 which was released Aug 14, 2017:

# g++-7 --version
g++-7 (Debian 7.2.0-1) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.

@mikayla-grace
Copy link

The patch was just the latest update to GCC 7.1, we did not make any changes to ImageMagick. We have access to Fedora, Ubuntu, and CentOS and test.cpp works fine on all of these systems. We do not have access to a Debian system so we're not sure how we can help. It could very well be a compiler issue.

@jeroen
Copy link
Contributor Author

jeroen commented Aug 30, 2017

Hmm I don't see any gcc 7.1.1 release on the GNU website, must have been a Fedora thing or so. I'll have to figure out what exactly they patched.

@jeroen
Copy link
Contributor Author

jeroen commented Dec 5, 2017

This may be related to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants