Dear Imran, typically, your MSVC2008 Compiler flags (CMAKE_X_FLAGS) are "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" in case you compile DEBUG, and "/MD /O2 /Ob2 /D NDEBUG" in case you compile RELEASE. /MD and /MDd indicate the type of linkage against the MS VC runtime libraries (e.g. msvcr90 / msvcr90d.dll). If you mix up libraries that link to DIFFERENT kinds of runtime libs it may result in heap corruption.
Mixing of runtimes may cause heap corruption: Each copy of the CRT library has a separate and distinct state. As such, CRT objects such as file handles, environment variables, and locales are only valid for the copy of the CRT where these objects are allocated or set. When a DLL and its users use different copies of the CRT library, you cannot pass these CRT objects across the DLL boundary and expect them to be picked up correctly on the other side. Also, because each copy of the CRT library has its own heap manager, allocating memory in one CRT library and passing the pointer across a DLL boundary to be freed by a different copy of the CRT library is a potential cause for heap corruption. (http://msdn.microsoft.com/en-us/library/ms235460.aspx) One may increase the speed of debug build types a bit. Although this comes along with other things to consider... http://developer.qt.nokia.com/faq/answer/why_is_the_debug_version_of_my_application_so_slow http://bugs.mitk.org/show_bug.cgi?id=5281 (also some more information about this. Best Matthias -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Gesendet: Donnerstag, 27. Januar 2011 18:18 An: Baumhauer Matthias Cc: '[email protected]' Betreff: Re: [mitk-users] Building and Running MITK in Debug mode Dear Matthias, I built QT in debug mode by reconfiguring it as follows: C:\QT\...\bin> configure -debug -platform win32-msvc2008 -no-webkit Following this, I did a "nmake" to build and install the thing. Next, I rebuilt/installed MITK in debug mode. Still, the same issue... After this, I went back to ITK, rebuilt/installed ITK in Debug mode; rebuilt/installed QT again in Debug mode (as above); rebuilt/installed VTK in Debug mode, and then rebuilt/installed MITK in Debug mode again. Now, this time everything worked. Hmmmm.... I guess the news is good but I still don't understand why ITK and/or VTK needed to be built in Debug mode as well.... I understand why QT needed to be built in Debug mode, however. Anyhow, I just wanted to let you know what did and didn't work for me... Thanks for your help! -Imran. Quoting Baumhauer Matthias <[email protected]>: > > Dear Imran, > > as it is a debug build, you might be able to provide a stack trace or > do some debugging in order to track the problem. > > Furthermore, your error message is well known for either mixing debug > and release libs or for static QT objects that are initialized before > the main gets control. > > Google has very many hints on this: > http://www.qtcentre.org/threads/10959-QWidget-Must-construct-a-QApplic > ation-before-a-QPaintDevice > > Best > Matthias > > > -----Ursprüngliche Nachricht----- > Von: [email protected] [mailto:[email protected]] > Gesendet: Freitag, 21. Januar 2011 00:29 > An: [email protected] > Betreff: [mitk-users] Building and Running MITK in Debug mode > > Hi, > > I built MITK 0.99.1 in Debug mode in the MSVS-2008 environment. It > built and installed fine. The install directory that I specified is: > "e:\Program Files (x86)\MITK-Debug\bin". Now, when I run "ExtApp.exe" > from the command prompt, I get the following error: > > E:\Program Files (x86)\MITK-Debug\bin>ExtApp.exe Thu Jan 20 15:25:39 > 2011 > 0.05 ext.alg.coreExtObjFac: Registering CoreExtObjectFactory... > 0.05 core.alg.coreObjFac: CoreObjectFactory c'tor > 0.05 ext.alg.coreExtObjFac: CoreExtObjectFactory c'tor > 0.06 core.alg.coreObjFac: CoreObjectFactory: registering extra factory > of type C oreExtObjectFactory > 0.48 core.mod.planArfigure.objFac: Registering PlanarFigureObjectFactory... > 0.49 core.mod.planArfigure.objFac: PlanarFigureObjectFactory c'tor > 0.49 core.alg.coreObjFac: CoreObjectFactory: registering extra factory > of type P lanarFigureObjectFactory > 0.56 core.ui.regCls: QmitkRegisterClasses() > 0.56 ext.ui.extRegCls: QmitkExtRegisterClasses() > QWidget: Must construct a QApplication before a QPaintDevice > > > > > The last line is the offending line. Any ideas on how to fix this? > > Thanks! > > -Imran. > > > ---------------------------------------------------------------------- > -------- Special Offer-- Download ArcSight Logger for FREE (a $49 USD > value)! > Finally, a world-class log management solution at an even better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > mitk-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mitk-users > ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
