- All (478)
- jom (0)
- Qt Linguist (7)
- Qt Eclipse Integration (9)
- Qt Designer (7)
- Qt Creator (4)
- Qt build system: qmake (31)
- Qt build system: configure (3)
- Qt Assistant (5)
- Printing (4)
- Porting from Qt 3 to Qt 4 (1)
- Plugins (7)
- Qt Visual Studio AddIn (2)
- Qt/MFC Migration (2)
- QtScript (3)
- MDI (2)
- XML (1)
- Widgets (22)
- WebKit (5)
- Tools and Containers (2)
- Threads (2)
- Text Handling (10)
- SQL (6)
- QtTest (1)
- QtService (1)
- Platform: Windows (49)
- Platform: Unix (16)
- Platform: Mac OS X (18)
- Image Formats (2)
- I/O (2)
- Graphicsview (8)
- Font handling (9)
- Event System (18)
- Drag and Drop (4)
- Dialogs (6)
- Desktop integration (3)
- ActiveQt (3)
- Itemviews (60)
- Layout (4)
- Qt Quick (10)
- Qt SDK (1)
- Licensing (2)
- Platform: Embedded Linux (38)
- Painting (32)
- OpenGL (4)
- Object Model (6)
- Network (5)
- Multimedia (3)
- Miscellanous (23)
- Main Window (19)
- Look and Feel (23)
- Development (0)
- Getting Involved (0)
- Routines (0)
When using Qt with STL it crashes with a memory access exception, how do I fix this?
If this happens, then the problem is usually either one of two things:
- A mismatch of runtime libraries – If you have built Qt in release mode and
your application in debug mode this means that it will be using two different
runtime libraries. A release C runtime for Qt and a debug C runtime for your
application. This means that there are two heaps in use and as a result if
objects get passed from one heap to another (i.e. from Qt to the application
and vice versa) then memory corruption will occur. You can usually catch this
at build time, if you see a link warning about default libraries then this is
usually indicitive of this problem. The only way to resolve it is to ensure
that Qt and your application is built in the same mode. With Qt 4, by default
both versions are available so you should not encounter this problem.
- The environment variables are not set correctly – If you have more than
one compiler installed on your machine, then it is possible that the
environment variables (particularly INCLUDE and LIB) are not pointing to the
right compiler. You should ensure that the environment variables match the
compiler that you are actually using to build and run the application.

1 comment
November 10, 2010
Lab Rat
I compiled every single library in my project with /MDd and I still get one of these crashes.
See http://developer.qt.nokia.com/forums/viewthread/1690