(solved) Imagemagick 6.6.9-1 Build Problems

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
markmarques
Posts: 88
Joined: 2010-06-29T14:36:09-07:00
Authentication code: 8675308

(solved) Imagemagick 6.6.9-1 Build Problems

Post by markmarques »

I am using VStudio 2005 to build Imagemagick 6.6.9-1 ...

Followed the docs ( previous versions compiled fine ...)

changed options :
#define MAGICKCORE_QUANTUM_DEPTH 64
and
#define MAGICKCORE_HDRI_SUPPORT
I get several ( 265+) errors :
Error 1 fatal error C1189: #error : "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64" d:\ImageMagick-source\magick\magick-type.h 99
and so on ...

But If define with the following options:

#define MAGICKCORE_QUANTUM_DEPTH 32
and
#define MAGICKCORE_HDRI_SUPPORT

I get :
Error 300 error LNK2019: unresolved external symbol _RegisterHDRImage referenced in function _RegisterStaticModules core_db_magick_.lib
Error 301 error LNK2019: unresolved external symbol _RegisterHDRImage referenced in function _RegisterStaticModules core_db_magick_.lib
Error 302 error LNK2019: unresolved external symbol _UnregisterHDRImage referenced in function _UnregisterStaticModules core_db_magick_.lib
Error 303 fatal error LNK1120: 2 unresolved externals ..\bin\animate.exe
Error 304 fatal error LNK1120: 2 unresolved externals ..\bin\compare.exe
Error 305 error LNK2019: unresolved external symbol _RegisterHDRImage referenced in function _RegisterStaticModules core_db_magick_.lib
...
for all the executables ....


Any idea for what is happening ?
Last edited by markmarques on 2011-03-30T11:02:10-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Imagemagick 6.6.9-1 Build Problems

Post by magick »

RegisterHDRImage() is in ImageMagick-6.6.9-1/coders/hdr.c. Make sure its included in your Visual Studio build. You may need to clean the solution and compile from scratch.
markmarques
Posts: 88
Joined: 2010-06-29T14:36:09-07:00
Authentication code: 8675308

Re: Imagemagick 6.6.9-1 Build Problems

Post by markmarques »

By default I always "clean" the solution previous to a build up ...
I noticed that the "hdr.c" file is also included as default ...

The Visual Studio error link sends me to "magick-type.h" ...




Any more ideas ?

another subject :
still haven´t found an easy way to include the FFT part with Windows.... :(
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Imagemagick 6.6.9-1 Build Problems

Post by el_supremo »

In magick-type.h, it tests for 64-bit quantum like this:

Code: Select all

#elif (MAGICKCORE_QUANTUM_DEPTH == 64) && defined(MAGICKCORE_HAVE_LONG_DOUBLE_WIDER)
so you probably need to make sure that MAGICKCORE_HAVE_LONG_DOUBLE_WIDER is defined. My magick-config.h (Q16) has this code:

Code: Select all

/* Define to 1 if the type `long double' works and has more range or precision
   than `double'. */
#ifndef MAGICKCORE_HAVE_LONG_DOUBLE_WIDER
#define MAGICKCORE_HAVE_LONG_DOUBLE_WIDER 1
#endif
Try defining that constant when you run configure and see if that helps.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Imagemagick 6.6.9-1 Build Problems

Post by el_supremo »

For the FFT part of the build, here are my (chaotic) notes on how I got it working. Some of it may be out of date (e.g. you may not need to define _WIN32_WINNT any more.

- Download the current FFTW binary from http://www.fftw.org/install/windows.html and unzip it to a directory such as c:\fftw-3.2.2.
- Start up the Control Panel program, select System|Advanced|Environment Variables and add c:\fftw-3.2.2 to the System's PATH environment variable so that the system can find the DLL whenever an IM command is executed.

For (MSVC 10) you must also add these to the PATH so that it finds lib.exe and mspdb100.dll:

Code: Select all

	c:\program files (x86)\Microsoft Visual Studio 10.0\vc\bin;c:\program files (x86)\Microsoft Visual Studio 10.0\Common7\ide
- Read the file README-WINDOWS in the fftw distribution because in order to use the DLL with IM you must run the lib command as described in that file. You only need to do it for whichever floating point format your system uses - the default is 32-bit double. The others are single precision float (f) or long double (l). Just execute one of these commands, as appropriate, in the c:\fftw-3.2.2 directory:

Code: Select all

	lib /def:libfftw3-3.def          (for 32-bit double)
	lib /def:libfftw3f-3.def          (for single-precision float)
	lib /def:libfftw3l-3.def          (for long double)
Building configure:
- Start up MSVC and select the configure solution in visualmagick\configure.
- Select Build|Configuration Manager and change the build configuration to Release. Now build the program.
- Run the configure program.
- In the dialog, click Next.
- In the next dialog window, select "Edit magick-config.in". This will start up notepad and allows you to edit the file. Check that MAGICKCORE_QUANTUM_DEPTH is the required value (in your case 64) and after it you may have to add (as per my previous post)

Code: Select all

			#define MAGICKCORE_HAVE_LONG_DOUBLE_WIDER 1
then check that MAGICKCORE_HDRI_SUPPORT is defined. Finally, after HDRI, add this:

Code: Select all

			#define MAGICKCORE_FFTW_DELEGATE
			#define _WIN32_WINNT 0x0501
The _WIN32 define is so that InitializeCriticalSectionandSpinCount is linked in (there was a bug in a previous version of IM and this may not be required any more). It must occur before <windows.h> is included so I've put it in here
- Save the file and then finish the rest of the configure dialog. The program will then write your selected configuration and create a solution file which you can now use to build IM.

To build IM, run MSVC again and open the solution file that configure writes in the VisualMagick directory (e.g. VisualDynamicMT.sln).
- If you want a Release version of IM, change the build configuration to Release in the same way as described above for the configure program.
- Before compiling, the properties of the Core_Magick project must be modified. Find that project in the list, right click on it and select Properties:
- in C/C++|General|additional includes add the path to the fftw directory: c:\fftw-3.2.2
- in linker|General|additional libraries directory add the path to the fftw directory: c:\fftw-3.2.2
- in linker|Input|additional dependencies add libfftw3-3.lib

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
markmarques
Posts: 88
Joined: 2010-06-29T14:36:09-07:00
Authentication code: 8675308

Re: (solved) Imagemagick 6.6.9-1 Build Problems

Post by markmarques »

Using "el_supremo" code in magick-config.h

Code: Select all

/* Define to 1 if the type `long double' works and has more range or precision than `double'. */
#ifndef MAGICKCORE_HAVE_LONG_DOUBLE_WIDER
#define MAGICKCORE_HAVE_LONG_DOUBLE_WIDER 1
#endif
worked flawlessly and compiled correctly ...

Thanks ....

( Regarding the FFT as soon I get the time I will post more info)
Post Reply