Building under MinGW, need step by step guide

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.
dannyyy

Re: Building under MinGW, need step by step guide

Post by dannyyy »

Hi ! HAPPY HALLOWEEN !!!

I took a shortcut...the only file I really needed was really "wmfconfig.h", so I just renamed the file wmfconfig.h.in which was inside the WMF folder and altered some defines.

Now ImageMagick is compiling perfectly using MinGW and CodeBlocks. Later I will make the files available and write a detailed README.

The only problem I'm having now is about the debug version. On the file "nt-base.h", lines 38 to 40, there is the following:

Code: Select all

#if defined(_DEBUG)
#include <crtdbg.h>
#endif
...but MinGW doesn't has this header. What can I do in this case ?

Oh, and thanks for the help so far !
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Building under MinGW, need step by step guide

Post by magick »

Try changing the conditional compile statement to:
  • #if defined(_DEBUG) && !defined(__MINGW32__)
and let us know if that fixes the problem.
dannyyy

Re: Building under MinGW, need step by step guide

Post by dannyyy »

It returned the following errors:

Code: Select all

...
...
E:\ImageMagick-6.3.6\magick\magick.c -o ..\Debug\CORE_magick\magick\magick.o
E:\ImageMagick-6.3.6\magick\magick.c: In function `MagickCoreGenesis':
E:\ImageMagick-6.3.6\magick\magick.c:1137: error: `_CRTDBG_REPORT_FLAG' undeclared (first use in this function)
E:\ImageMagick-6.3.6\magick\magick.c:1137: error: (Each undeclared identifier is reported only once
E:\ImageMagick-6.3.6\magick\magick.c:1137: error: for each function it appears in.)
E:\ImageMagick-6.3.6\magick\magick.c:1138: error: `_CRTDBG_CHECK_ALWAYS_DF' undeclared (first use in this function)
E:\ImageMagick-6.3.6\magick\magick.c:1138: error: `_CRTDBG_DELAY_FREE_MEM_DF' undeclared (first use in this function)
E:\ImageMagick-6.3.6\magick\magick.c:1139: error: `_CRTDBG_LEAK_CHECK_DF' undeclared (first use in this function)
Process terminated with status 1 (1 minutes, 18 seconds)
6 errors, 0 warnings
Are those functions VC++ specific ? Or I can find it on the MinGW/GCC headers ?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Building under MinGW, need step by step guide

Post by magick »

Change the conditional compile in that area to
  • #if defined(_DEBUG) && !defined(__BORLANDC__) && !defined(__MINGW32__)
Sometimes the Windows environment is interpreted in a Visual C context and other times in a Unixy/gcc context. We have not compiled ImageMagick under MinGW lately so you are tripping across a few compatibility issues. Thanks for alerting us to these problems.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Building under MinGW, need step by step guide

Post by magick »

We downloaded the latest release of ImageMagick under the MSYS shell and ImageMagick compiled without complaint as follows:
  • bunzip -c ImageMagick-6.3.7-2.tar.bz2 | tar xvf -
    cd ImageMagick-6.3.7
    ./configure --disable-shared
    make
    make -k -i install
    convert logo: logo.miff
    identify -verbose logo.miff
We tried compiling with --enable-shared but an internal compiler error exception was thrown.
Post Reply