Usually this means that the "new" was performed with either (1) the statically linked in MSVC runtime libraries or (2) the dll version of MSVCRT and the "delete" is being performed by the other one. This sort of mismatch will almost always eventually lead to a heap corruption.
<br><br>All of your components that do cross-component new/delete operations have to be linked to the same flavor (static or dll) or the MSVC runtime libraries.<br><br>Are you sure that *everything* is compiled with /MT??
<br><br>I would try starting again with a clean binary directory to ensure that /MT is actually used to compile *everything*. Then, also make sure there are no other versions of VTK dll's in your PATH environment variable.
<br><br>If it still happens after that, we can continue discussing other ways to figure out why this might be happening for you..... It should work.<br><br><br>HTH,<br>David<br><br><br><div><span class="gmail_quote">On 11/14/07,
<b class="gmail_sendername">hu ning</b> <<a href="mailto:nickhuning@hotmail.com">nickhuning@hotmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
Hi,<br><br>I wonder if anyone here has experienced this kind of problem and could give me some advice: I have to build the vtk 5.0.3 shared libraries with /MT instead of /MD on VC++ 8, then every time when my application start initializing vtkRenderWindow it crashes. I am able to find in the class vtkOpenGLRenderWindow:
<br>vtkOpenGLRenderWindow::vtkOpenGLRenderWindow()<br>{<br> this->MultiSamples = vtkOpenGLRenderWindowGlobalMaximumNumberOfMultiSamples;<br> this->TextureResourceIds = vtkIdList::New();<br> if ( this->WindowName )
<br> delete [] this->WindowName; ########## crash here<br> this->WindowName = new char[strlen("Visualization Toolkit - OpenGL")+1];<br> strcpy( this->WindowName, "Visualization Toolkit - OpenGL" );
<br>}<br><br>when it try to delete [] this->WindowName, there is memory corruption. I checked the content in the this->WindowName and it seems correct.<br><br>I also tested with the same vtk version with /MD build which is default setting, and it runs ok. The reason I need to have /MT because all the components in my app are built with /MT. The previous release of vtk,
4.2, doesn't have this problem.<br><br>Any discussion/advice will be highly appreciated!<br><br>Thank you,<br><br>Nick<br><br><hr>Are you ready for Windows Live Messenger Beta 8.5 ? <a href="http://entertainment.sympatico.msn.ca/WindowsLiveMessenger" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Get the latest for free today!</a></div>
<br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br></blockquote></div><br>