Cannot build ImageMagick-6.5.3-10 on MinGW

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
chauk-mean

Cannot build ImageMagick-6.5.3-10 on MinGW

Post by chauk-mean »

Hi,

I've been able to build successfully ImageMagick-6.5.2-7 on MinGW stable release (gcc-3.4.5) + MSYS-1.0.11-rc1 on Windows XP.

Unfortunately, I cannot build IM anymore with recent versions (e.g. 6.5.3-10). Here is the result :

/bin/sh ./libtool --silent --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONF
IG_H -I. -I./config -I./ltdl -I./ltdl -I/mingw/include/freetype2 -I/mingw/incl
ude -IC:/opt/gtk+-2.16.1/include -D_LIB -D_MT -g -O2 -Wall -W -MT coders/magick
_libMagickCore_la-avi.lo -MD -MP -MF coders/.deps/magick_libMagickCore_la-avi.Tp
o -c -o coders/magick_libMagickCore_la-avi.lo `test -f 'coders/avi.c' || echo '.
/'`coders/avi.c
In file included from c:/mingw/include/jpeglib.h:26,
from coders/avi.c:78:
c:/mingw/include/jmorecfg.h:227: error: conflicting types for 'boolean'
c:/mingw/include/rpcndr.h:52: error: previous declaration of 'boolean' was here
make[1]: *** [coders/magick_libMagickCore_la-avi.lo] Error 1
make[1]: Leaving directory `/c/HOME/mingw/ImageMagick-6.5.3-10'
make: *** [all] Error 2

The options I used for building zlib-1.2.3 :
./configure --prefix=/mingw

The options I used for building the delegates (freetype-2.3.9, libpng-1.2.35, jpegsrc.v6b, tiff-3.8.2) :
./configure --prefix=/mingw --disable-shared

The options I used for ImageMagick :
./configure --prefix=/mingw --without-perl --without-magick-plus-plus --disable-shared --with-quantum-depth=8

Again, the build works fine with ImageMagick-6.5.2-7.

Thanks.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Post by magick »

The problem is a conflict in header files under MinGW and has little to do with ImageMagick. You could disable JPEG support with

./configure --without-jpeg

or patch the conflicting header files. Otherwise you will need to post a bug report to the MinGW developers to get the problem fixed.
chauk-mean

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Post by chauk-mean »

>The problem is a conflict in header files under MinGW and has little to do with ImageMagick.
>You could disable JPEG support with
>...

Disabling JPEG is a workaround but is not really usable in my case (I need JPEG).
And as I indicated in my initial post, with the same environment, the build of ImageMagick-6.5.2-7 with the JPEG support works fine.

>Otherwise you will need to post a bug report to the MinGW developers to get the problem fixed.

I'm quite confused. I've posted this bug report on the 'Developers' forum. So where should I post the bug report ?

Thanks.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Post by magick »

where should I post the bug report
Post it to the MinGW bugs forum. The conflict is in the MinGW headers which the ImageMagick developers have no control over.
chauk-mean

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Post by chauk-mean »

magick wrote:
where should I post the bug report
Post it to the MinGW bugs forum. The conflict is in the MinGW headers which the ImageMagick developers have no control over.
The problem doesn't seem to come from MinGW headers. I've built ImageMagick-6.5.2-7 successfully.
It seems more related with the "configure script" used by recent versions of ImageMagick.
Indeed, I've just noticed from the changelog that the automake / autoconf scripts have been rebuilt as of ImageMagick-6.5.2-9 :

2009-05-25 6.5.2-9 Cristy <quetzlzacatenango@image...>
# Do not change opacity value for the -alpha background option.
# Rebuild automake / autoconf scripts.

I've just tried to build ImageMagick-6.5.2-9 and I have the same problem as for 6.5.3-x versions.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Post by magick »

  • In file included from c:/mingw/include/jpeglib.h:26,
    from coders/avi.c:78:
    c:/mingw/include/jmorecfg.h:227: error: conflicting types for 'boolean'
    c:/mingw/include/rpcndr.h:52: error: previous declaration of 'boolean' was here
These errors come from system headers which the developers have no control over. It seems boolean is declared here: c:/mingw/include/rpcndr.h and then again at c:/mingw/include/jmorecfg.h. From the header comments it looks like you need to define HAVE_BOOLEAN to get past the error. We build ImageMagick under MinGW for each new release and we do not get this error. Not sure why you are getting it.
chauk-mean

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Post by chauk-mean »

magick wrote:We build ImageMagick under MinGW for each new release and we do not get this error. Not sure why you are getting it.
Are you building IM from MSYS or Cygwin ?

Could you please provide me the options you use for configure ?

I'm using the following for zlib, freetype, libpng, jpeg and tiff :
* for building zlib-1.2.3 :
./configure --prefix=/mingw

* options for the delegates freetype-2.3.9, libpng-1.2.35, jpegsrc.v6b, tiff-3.8.2 :
./configure --prefix=/mingw --disable-shared

* options for ImageMagick :
./configure --prefix=/mingw --without-perl --without-magick-plus-plus --disable-shared --with-quantum-depth=8

Thanks.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Post by magick »

We build under MnGW and Cygwin before a release. Unfortunately the build environment is at a remote location and we won't have access to it for several days. We do have a few preferred configure options but ImageMagick has built without any command line options on both these systems.
sannosuke
Posts: 1
Joined: 2011-04-27T17:05:38-07:00
Authentication code: 8675308

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Post by sannosuke »

I know this is an old thread, but I recently tried to build ImageMagick-6.6.9-6 on MinGW and it still came up with the same error.

I noticed that in the JPEGLIB header 'jmorecfg.h' declared 'boolean' as 'int',

Code: Select all

/*
 * On a few systems, type boolean and/or its values FALSE, TRUE may appear
 * in standard header files.  Or you may have conflicts with application-
 * specific header files that you want to include together with these files.
 * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
 */

#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
while the ImageMagick source file 'coders/jpeg.c' pre-declared 'boolean' as 'unsigned char'

Code: Select all

#if defined(__MINGW32__)
# define XMD_H 1  /* Avoid conflicting typedef for INT32 */
typedef unsigned char boolean;
#endif
As a workaround, I commented out the typedef statement in the 'coders/jpeg.c' file.

Code: Select all

#if defined(__MINGW32__)
# define XMD_H 1  /* Avoid conflicting typedef for INT32 */
//typedef unsigned char boolean; /*<-- COMMENTED OUT this line */
#endif
Compiled successfully with

Code: Select all

--configure --prefix=/mingw --enable-static --disable-shared
Command-line binaries (convert, etc.) worked, too.
mozes
Posts: 1
Joined: 2012-08-29T23:37:01-07:00
Authentication code: 67789

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Post by mozes »

Compiling on mingw then trying to generate a jpeg, I was getting "JPEG parameter struct mismatch: library thinks size is 432, caller expects 416". Getting rid of "typedef unsigned char boolean;" in jpeg.c seems to have fixed the parameter mismatch.

#if defined(__MINGW32__)
# define XMD_H 1 /* Avoid conflicting typedef for INT32 */
/* fix JPEG parameter struct mismatch on mingw */
// typedef unsigned char boolean;
// #define HAVE_BOOLEAN
#endif

Moses
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Post by magick »

We'll get a patch into the next point release of ImageMagick. Thanks.
Post Reply