Page 1 of 1

Magick++ API Access Violation on Image::Read()

Posted: 2011-03-25T08:24:21-07:00
by cesareof
Recently installed ImageMagick with: ImageMagick-6.6.8-1-Q16-windows-dll.exe On WindowsXP Professional.
The Magick++_Demo builds fine in VIsualStudio 2005 without any issues. However when I try to debug the code I run into an Access Violation Exception in the button.cpp file.

This code segment :

Code: Select all

   
 //
    // Magick++ operations
    //

    Image button;

    // Set button size
    button.size( buttonSize );

    // Read background image
    button.read( backGround );

Output from VisualStudio 2005:

Code: Select all

'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\Magick++_Demo_VS05\button.exe', Symbols loaded.
'button.exe': Loaded 'NOT_AN_IMAGE', No symbols loaded.
'button.exe': Unloaded 'NOT_AN_IMAGE'
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\ntdll.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\kernel32.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\CORE_RL_Magick++_.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\CORE_RL_magick_.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\X11.dll', Binary was not built with debug information.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\msvcrt.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\wsock32.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\ws2_32.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\ws2help.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\advapi32.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\rpcrt4.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\secur32.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\user32.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\gdi32.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\CORE_RL_bzlib_.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\msvcr100.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\CORE_RL_lcms_.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\CORE_RL_ttf_.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\CORE_RL_zlib_.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\vcomp100.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\CORE_RL_wand_.dll', No symbols loaded.
'button.exe': Loaded 'C:\Program Files (x86)\ImageMagick-6.6.8-Q16\msvcp100.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\msvcp80.dll', Symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\msvcr80.dll', Symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\imm32.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\lpk.dll', No symbols loaded.
'button.exe': Loaded 'C:\WINDOWS\SysWOW64\usp10.dll', No symbols loaded.
First-chance exception at 0x78ab0a9d in button.exe: 0xC0000005: Access violation reading location 0x00130000.
Unhandled exception at 0x78ab0a9d in button.exe: 0xC0000005: Access violation reading location 0x00130000.
If I can't get the demos to run how am I going to integrate the API into my existing code?

Re: Magick++ API Access Violation on Image::Read()

Posted: 2011-03-25T08:26:58-07:00
by magick
ImageMagick was build with Visual Studio 2010. Most likely there is an incompatibility between VS 2005 and VS 2010. The solution may be to build ImageMagick from the source distribution with VS 2005 and install it. The ImageMagick Magick++ demos will most certainly work then.

Re: Magick++ API Access Violation on Image::Read()

Posted: 2011-03-25T14:00:43-07:00
by cesareof
Installed the ImageMagick from source Built the project using the instruction http://www.imagemagick.org/script/install-source.php Now I am seeing another exception: ImageMagick::ErrorMissingDelegate.

Is there some other step I am missing in building this project for use?

Re: Magick++ API Access Violation on Image::Read()

Posted: 2011-03-25T14:07:25-07:00
by magick
Did you define MAGICKCORE_INSTALLED_SUPPORT in magick-config.h? If not, you must define the MAGICK_HOME environment variable so ImageMagick can find its configuration files.

Re: Magick++ API Access Violation on Image::Read()

Posted: 2011-04-05T13:24:30-07:00
by cesareof
I used the default to build the ImageMagick project which does not define the MAGICKCORE_INSTALLED_SUPPORT preprocessor directive. So I defined PATH and MAGICK_HOME to point to the location where the IM_MOD_*.dll and the CORE_*.dll are located in my case:

Code: Select all

#define MAGICK_HOME "d:\\Projects VS05\\ImageMagick-6.6.8\\VisualMagick\\bin"
#define PATH "d:\\Projects VS05\\ImageMagick-6.6.8\\VisualMagick\\bin"
I was using IMG.dll before for all my image editing purposes and although it is no longer supported it was much easier to implement into my project. One *.h file included in the header and one *.lib file as an "Additional Dependencies" and a *.dll file included in the SYstem 32 directory. Is there anyway to include the ImageMagick API in a similar manner into a C++ project?

Re: Magick++ API Access Violation on Image::Read()

Posted: 2011-04-05T14:42:01-07:00
by cesareof
Scratch the last comment.

I built ImageMagick from source in Visual Studio 2005 and the Demo projects seems to be working properly, I will now go through the arduous task of implementing these libraries into my existing project.

Thanks for the help.

Re: Magick++ API Access Violation on Image::Read()

Posted: 2017-03-03T03:53:46-07:00
by rajeevraina
May I please know the steps taken by you to get it working.