Page 1 of 1

Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2009-06-24T00:43:23-07:00
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.

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2009-06-24T05:47:16-07:00
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.

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2009-06-24T06:48:39-07:00
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.

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2009-06-24T08:07:42-07:00
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.

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2009-06-27T07:03:42-07:00
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.

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2009-06-27T08:05:28-07:00
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.

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2009-06-27T09:07:28-07:00
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.

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2009-06-27T09:45:07-07:00
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.

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2011-04-27T17:21:51-07:00
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.

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2012-08-29T23:51:00-07:00
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

Re: Cannot build ImageMagick-6.5.3-10 on MinGW

Posted: 2012-08-30T03:56:37-07:00
by magick
We'll get a patch into the next point release of ImageMagick. Thanks.