<font size="2"><font face="verdana,sans-serif">Or you can configure ITK not to use DLLs, and avoid this issue altogether.<br></font></font><div><font class="Apple-style-span" face="verdana, sans-serif"><br></font></div><div>
<font class="Apple-style-span" face="verdana, sans-serif">HTH<br></font></div><div><div class="gmail_quote"><br></div><div class="gmail_quote">On Tue, Jul 19, 2011 at 16:51, John Drescher <span dir="ltr"><<a href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Tue, Jul 19, 2011 at 10:21 AM, JOJOW <<a href="mailto:jieqiong.wang17@gmail.com">jieqiong.wang17@gmail.com</a>> wrote:<br>
> I compiled itk in vs2008. There is a problem in the example of itk. The<br>
> code is<br>
> #include "itkImage.h"<br>
> #include "itkImageFileReader.h"<br>
> int main( int , char * argv[])<br>
> {<br>
> typedef unsigned char PixelType;<br>
> const unsigned int Dimension = 3;<br>
><br>
> typedef itk::Image< PixelType, Dimension > ImageType;<br>
> typedef itk::ImageFileReader< ImageType > ReaderType;<br>
> ReaderType::Pointer reader = ReaderType::New();<br>
> const char * filename ="mprage_noface.nii";<br>
> reader->SetFileName( filename );<br>
> reader->Update();<br>
> ImageType::Pointer image = reader->GetOutput();<br>
><br>
> return 0;<br>
> }<br>
><br>
> If I choose release mode, the result is correct. But If I choose debug mode,<br>
> when the code run to reader->update(), there is an error:<br>
> Unhandled exception at 0x00ae7ca0 in *.exe: 0xC0000005: access conflict<br>
> occours when read location 0xcccccccc<br>
><br>
> I don't know what's wrong!<br>
><br>
<br>
</div>When you built ITK did you install it using the INSTALL target? If so<br>
that is your problem. The reason is you can not mix debug and release<br>
libraries in the same application. In visual studio Debug and Release<br>
have different incompatible memory heaps. So you must build all for<br>
Release or Debug and not mix the two.<br>
<font color="#888888"><br>
John<br>
</font><div><div></div><div class="h5">_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br></div>