mingw-w64 dllimport definition

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
ekpyron
Posts: 1
Joined: 2014-06-15T21:50:29-07:00
Authentication code: 6789

mingw-w64 dllimport definition

Post by ekpyron »

I tried to compile and use ImageMagick-6.8.9-3 on 64-bit Windows 7 with mingw-w64 (gcc 4.8.2 seh) and msys.
The build failed for me (with any conceivable combination of configure options) with linking errors in the form of "undefined reference to __imp_[imagemagick entry point] (e.g. __imp_MagickWandGenesis).
The output of "nm libMagickWand.dll.a | grep MagickWandGenesis" was

0000000000000000 I __imp_MagickWandGenesis
0000000000000000 T MagickWandGenesis

The problem can be fixed by changing

#define WandExport __attribute__((dllimport))

into

#define WandExport

in wand/method-attribute.h

and similarily changing the define MagickExport in magick/method-attribute.h.

It might be good to add an appropriate #ifdef to */method-attribute.h to avoid the incorrect symbol naming altogether on win64/mingw-w64.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: mingw-w64 dllimport definition

Post by magick »

We had to make a couple of minor patches but ImageMagick compiled with these commands:
  • cd ImageMagick-6.8.9-4
    ./configure --disable-shared
    make
We're using gcc.exe (tdm64-2) 4.8.1 in the MinGW 64-bit build environment. Download 6.8.9-4 from the normal download locations but in the 'beta/' folder. Do not download until tomorrow. We need time for the patches to mirror.
Post Reply