In src/ipa/xgd/device.h at line 24 in function wmf_gd_device_open the following lines appear:
...
#ifndef HAVE_LIBPNG
wmf_gd_t* ddata = WMF_GD_GetData (API);
#endif
...
Later in the function, both HAVE_LIBPNG and HAVE_LIBJPEG are checked in ifndef statements. Both use ddata, but as is apparent above, it is only declared when HAVE_LIBPNG is not declared. It should be declared if either HAVE_LIBPNG or HAVE_LIBJPEG are not declared.
Suggest changing those lines to something like:
...
#if !defined(HAVE_LIBPNG) || !defined(HAVE_LIBJPEG)
wmf_gd_t* ddata = WMF_GD_GetData (API);
#endif
...