[vtkusers] release/debug modes in MSVC

Dominik Szczerba dominik at itis.ethz.ch
Tue Nov 4 11:28:41 EST 2008


Marcus Lindblom wrote:
> 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?

Actually, I just need it for one function. Thanks for the hint!

Dominik


> 
> Cheers,
> /Marcus
> 



More information about the vtkusers mailing list