Page 1 of 1

IM stopped working on OS X Mavericks

Posted: 2013-10-27T07:25:50-07:00
by mlo
Hello - Yesterday I switched to OS X 10.9; deinstalled and reinstalled MacPorts; and installed IM. The version is:

Code: Select all

ImageMagick @6.8.7-3_0+x11 (active) platform='darwin 13' archs='x86_64'
Suddenly, I cannot create C++ executables that use Magick++ anymore: a minimal example is:

Code: Select all

MLO@bigmac 16 $ cat minimal.cxx 
#include <iostream>
#include <Magick++.h>

using namespace std;
using namespace Magick;

int main() {
  try {
    Image newImage("logo.jpg");
    newImage.zoom("50x");
    newImage.write("newlogo.jpg");
  } catch (Error &e) {
    cerr << e.what() << '\n';
  } catch (...) {
    cerr << "Unknown exception catched\n";
  }
}
MLO@bigmac 17 $ g++ `Magick++-config --cppflags --cxxflags --ldflags --libs` -o minimal minimal.cxx
Undefined symbols for architecture x86_64:
  "Magick::Image::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      _main in ccMyhbLg.o
  "Magick::Image::Image(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      _main in ccMyhbLg.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
I have no idea of what's happening; please...

Re: IM stopped working on OS X Mavericks

Posted: 2013-10-27T07:29:01-07:00
by mlo
Well, I forgot to insert the output of the config command; if it helps, it is here:

Code: Select all

MLO@bigmac 18 $ Magick++-config --cppflags --cxxflags --ldflags --libs
-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/local/include/ImageMagick-6 
-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/local/include/ImageMagick-6 
-L/opt/local/lib -lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16 
-L/opt/local/lib -lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16 
Thank you in advance for any suggestion...

Re: IM stopped working on OS X Mavericks

Posted: 2013-10-27T09:46:06-07:00
by fmw42

Re: IM stopped working on OS X Mavericks

Posted: 2013-10-27T10:54:19-07:00
by mlo
fmw42 wrote: Does this help?
viewtopic.php?f=3&t=24326
Not at all, since I have all the .la modules in /opt/local/lib . They were missing in 6.8.7-2, and, as told in that thread, and reintroduced in 6.8.7-3 (the port I have installed). This solved another problem, not mine. Also the error message ("no decode delegate for this image format") is quite different from the one I got ("symbol(s) not found for architecture x86_64"). Why did you think that topic was relevant?

Re: IM stopped working on OS X Mavericks

Posted: 2013-10-29T23:12:23-07:00
by mlo
Well, that bug has been analyzed and solved in the Macports forum, see URL https://trac.macports.org/ticket/40993 . It turned out that all the Macports packages are now built using the compilers clang and clang++, and that clang++ mangles in its own way the procedure names. Using clang++ to compile and link the minimal example given produces no error and the executable runs correctly. It may be possible that the command line option -stdlib=libc++ is needed by the compiler/linker, but this point is not clear.

Problem solved - I just had to abandon my beloved gcc and switch to another compiler :(