I'm trying to perform a .emf to .png conversion on a Ubuntu 16.04 server.

Unfortunately .emf is a proprietary Windows format and so will not work natively.

I'm therefore trying to build GraphicsMagick for Windows and hopefully execute it with wine.

I've tried building from source with the following

./configure '--host=x86_64-w64-mingw32' '--disable-shared' as per the instructions here

But upon make it's failing with

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -D_LIB -D_MT -fopenmp -g -O2 -Wall -pthread -MT coders/magick_libGraphicsMagick_la-clipboard.lo -MD -MP -MF coders/.deps/magick_libGraphicsMagick_la-clipboard.Tpo -c coders/clipboard.c -o coders/magick_libGraphicsMagick_la-clipboard.o
coders/clipboard.c:44:24: fatal error: wingdi.h: No such file or directory
compilation terminated.
Makefile:8199: recipe for target 'coders/magick_libGraphicsMagick_la-clipboard.lo' failed
make[1]: *** [coders/magick_libGraphicsMagick_la-clipboard.lo] Error 1
make[1]: Leaving directory '/root/GraphicsMagick-1.3.25'
Makefile:4437: recipe for target 'all' failed
make: *** [all] Error 2
  • 1
    Download the precompiled version: imagemagick.org/script/binary-releases.php#windows Nov 2, 2016 at 12:36
  • Are you able to convert .emf to .png on wine? I'm able to execute ImageMagick portable x64 and convert jpg to png but emf gives me several errors like: fixme:gdiplus:GdipPlayMetafileRecord Not implemented for record type 401f
    – pablo
    Jan 3, 2017 at 21:18
  • I never could, I used an emf2png.exe I found under wine but the images came out greyscale!
    – Titan
    Jan 4, 2017 at 8:41

1 Answer 1


As suggested by Ipor Sircer, you'd probably be better off just downloading the Windows binaries provided by ImageMagick.

If you really want to build it from source, you need to install the MinGW-w64 cross-compiler:

sudo apt-get install mingw-w64

and restart the build process (./configure etc.).


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .