Page 1 of 1

Magick++: image reading collapse! HELP!

Posted: 2011-11-26T12:32:16-07:00
by JimJim
Recently i am learning Magick++.h, i installed the ImageMagick-6.7.3-7-Q16-windows-dll on my window7, and i use VS2010 professional edition.
Here is the problem:
i write a simple program for testing, the code is as follows:

Code: Select all

    #include <Magick++.h>
    using namespace std;
    using namespace Magick;
    int main()
    {	
    	
    	Image image( "E:/DataMining/dataset_2img/300.jpg");
    
    	return 0;
    }
It compiles good, but everytime i debug the program it gives a "Access violation reading location..."problem, where i does wrong? Is the image file path format wrong? Is it "E:\\DataMining\\dataset_2img\\300.jpg"? Please tell me, any advice would be a great help for me.
PS:VS2010 builds the Magick++_Demo very well.

Re: Magick++: image reading collapse! HELP!

Posted: 2011-11-26T13:53:59-07:00
by magick
It could be your IDE project configuration. Replace the source of the Button project in Magick++_demos with your code. Build and execute. Does it work now?

Re: Magick++: image reading collapse! HELP!

Posted: 2011-11-26T22:37:53-07:00
by JimJim
magick wrote:It could be your IDE project configuration. Replace the source of the Button project in Magick++_demos with your code. Build and execute. Does it work now?
Thank you for advice.
But it doesn't work, now i am really stuck, PLEASE HELP ME!

Re: Magick++: image reading collapse! HELP!

Posted: 2011-11-26T23:42:24-07:00
by JimJim
magick wrote:It could be your IDE project configuration. Replace the source of the Button project in Magick++_demos with your code. Build and execute. Does it work now?
Yes, it works !
I copied the project in explorer and removed files and added my files and it worked!But what's wrong with my previous settings? I cannot always do so, right?
My ImageMagick-6.7.3-Q16 folder's full path is E:\ProgramFiles\ImageMagick-6.7.3-Q16, and the include folder and lib folder are
E:\ProgramFiles\ImageMagick-6.7.3-Q16\include, E:\ProgramFiles\ImageMagick-6.7.3-Q16.
Previously, I created a project named CBIR2, and add the above cpp file to it. The setting of CBIR2 project property is shown in these image captures , please help find where is wrong or what should be added, thank you very much.

[img]
http://115.com/file/e7h1ylfr#
CBIR25.jpg
http://115.com/file/be4nzwe8#
CBIR24.jpg
http://115.com/file/e7h1yfco#
CBIR23.jpg
http://115.com/file/dpyj629k#
CBIR22.jpg
http://115.com/file/e7h1ywzy#
CBIR21.jpg[/img]