[vtkusers] release/debug modes in MSVC

Marcus Lindblom macke at yar.nu
Tue Nov 4 10:53:10 EST 2008


Dominik Szczerba wrote:
> Configuring with cmake, is it possible - other than hacking - to use 
> Release builds for VTK or PV *and* Debug mode for my own stuff? On linux 
> I can easily do that (with different CMAKE_BUILD_TYPE's), but on Windows 
> it seems in order to debug my own stuff I have to compile the whole VTK 
> / PV in debug mode, which I dont need/want - this is particularly 
> annoying with PV long compilation times. Selecting
> 'Debug' as the build mode looks for libraries in bin\Debug. 
> Unfortunately, just copying is not smart enough - I get mysterious 
> crashes tracing back nowhere.

You can't mix debug/release builds because they link to different 
runtime libs.

However, you can disable optimization in your release build. This gets 
you proper debugging in your code while everything else is fast (and not 
debuggable...)

I often do this on a file-to-file basis using #pragma optimize("", off) 
when I need debug a singular function in release. Doing it for the 
entire project is perhaps what you're looking for?

Cheers,
/Marcus




More information about the vtkusers mailing list