0xC0000005: Access violation reading location 0x00000000.

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
e7215798
Posts: 1
Joined: 2012-08-28T20:33:10-07:00
Authentication code: 67789

0xC0000005: Access violation reading location 0x00000000.

Post by e7215798 »

Hi everyone :

I install ImageMagick-6.7.8-10-Q16-windows-dll and use VS2008 to build my project.( I have also used VS2010 but it still not work. )

But when I want to read image, however , I meet a problem :(

This is my code and it looks very easy but it can't execute...

The error is occurred at image.read( "flower.jpg" ); this line.

First-chance exception at 0x71e21f77 (msvcr100.dll) in TestIM.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x71e21f77 (msvcr100.dll) in TestIM.exe: 0xC0000005: Access violation reading location 0x00000000.

Can somebody help me? THX

Code: Select all

#include "stdafx.h"


#include <Magick++.h>
#include <Magick++/Image.h>
#include <iostream> 
using namespace std; 
using namespace Magick; 

int main(int argc,char **argv) 
{ 
  InitializeMagick(*argv);
  InitializeMagick("C:\Program Files\ImageMagick-6.7.8-Q16");
  InitializeMagick("C:\Users\e7215798\Documents\Visual Studio 2008\Projects\TestIM\TestIM");

  Image image;
  try { 
    image.read( "flower.jpg" );

    image.crop( Geometry(100,100, 100, 100) );

    image.write( "x.gif" ); 
  } 
  catch( Exception &error_ ) 
    { 
      cout << "Caught exception: " << error_.what() << endl; 
      return 1; 
    } 
  return 0; 
}
Best Regards
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: 0xC0000005: Access violation reading location 0x00000000

Post by magick »

Go to c:\Program Files\ImageMagick-6.7.8-Q16\Magick++_demo. Click on the Button workspace, compile and run. Most likely it will work without complaint. Now use this workspace as a model for your own Magick++ project.
rajeevraina
Posts: 6
Joined: 2017-03-02T04:42:11-07:00
Authentication code: 1151

Re: 0xC0000005: Access violation reading location 0x00000000.

Post by rajeevraina »

Sorry, it is not working
Post Reply