Page 1 of 1

Windows debug vs release

Posted: 2009-07-14T04:09:46-07:00
by Ilan
I have just started to use ImageMagic, but I have been struggling with it for some days now.
I have some screen shots which I'd like to upload, but I can't figure out how to do so.
They would be useful in any discussions.

OK, without pictures, the problem is this: I tried to get a very simple program to go and it failed

Code: Select all

void Cttt1View::myMagic(void)
{
	InitializeMagick("");
	try {
		Image img1("c:\\ilan\\ctview\\model.miff");
		img1.write("c:\\temp\\xxxy.jpg");
	}
	catch(...) {
		int i = 0;
	}
}
I purposely hard coded the paths to avoid any ambiguities. The code crashes basically because it can't
find the file. If I purposely put in a non existent file, I will get the same error.
I looked at your demo program and that worked. I tried to break your demo program to see what would break it.
I couldn't break your demo and I couldn't get my program to recognize the file.
Finally, I decided that just maybe because I was using debug and you were using release, that could be something.
So I switched my compilation to release, and it all started to work.

I tried to step into your code, but I suspect I need the source code to do that. I could show you my stack trace
if I could upload an image. You can clearly see that it is 4 levels into your dlls.

BTW, since I went through the pain, I could post some images showing exactly what you have to fix in the Visual Studio project in order to work with your software. Still my problem at the moment is that it works ONLY in release mode and not in debug mode. To develop code in release mode isn't a serious way to work.

Thanks,
Ilan

Re: Windows debug vs release

Posted: 2009-07-14T05:31:11-07:00
by magick
You can compile ImageMagick yourself in debug mode. To get started using Magick++ we have demo projects that you can use as a template. Go to c:/Progam Files/ImageMagick-6.5.4-Q16/Magick++_demos and click on the Button workspace. Build and run. Now use this project as the template for your own project.

Re: Windows debug vs release

Posted: 2009-07-15T04:17:39-07:00
by Ilan
I spent many hours in the Magick++_Demo directory. It was my only way to guess what could possibly be wrong.
The template you talk about is for building demo.exe. The problem isn't with demo.exe, or even with my exe file.
Those I now know how to build properly. The problem is with CORE_RL_magick_.lib and CORE_RL_Magick++_.lib.
I assume the "RL" in the name stands for "release", as opposed to "debug".

If I am to compile, then I need to compile the dll's and the lib's for the CORE functions in the debug mode.
I have no template for this and I don't know how to do it. If it is too difficult, it may be easier to debug my
programs in release mode. Not nice, but possible.

Ilan