PDA

View Full Version : When run the exe ,came the error of run time!!!



wter27
19th January 2011, 14:33
when i put these codes into my program.It comes.

#include <QVector>
……some code……
QVector<int> question_type(6);
question_type[0]=1;
the error code is :

Microsoft Visual C++ Runtime Library
Runtime Error!
Program: D:\Mount&Blade\mount&blade.exe

this application has requested the runtime to terminate it in an unusual way.
please contact the application's support team for more information.
My os is the microsoft windows xp sp3,I installed both QT and Microsoft Visual C++ 6.0。
I can't get anything when i debug the program.Because there is no tips for me.So is it a program problem or just a bug of Visual C++.The memory of the computer is very normal.
So any suggestions?

high_flyer
19th January 2011, 14:48
run the application in a debugger and see on which line exactly it crashes.

wter27
20th January 2011, 06:04
So there is the debug information.i can't understand it .so any one can give me some advices?

ASSERT failure in QVector<T>::operator[]: "index out of range", file c:\QT\qt\include/QtCore/../../src/corelib/tools/qvector.h, line 347
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x0 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)
(Internal error: pc 0x4 in read in psymtab, but not in symtab.)

ASSERT failure in QVector<T>::operator[]: "index out of range", file c:\QT\qt\include/QtCore/../../src/corelib/tools/qvector.h, line 347
QWaitCondition: Destroyed while threads are still waiting

Added after 48 minutes:

So i find the problem.the array i defined before does not equal to the data.

high_flyer
20th January 2011, 08:40
run the application in a debugger and see on which line exactly it crashes.
With this I mean in you code!

The error tells you that you are referencing the vector out side its index range.
You better use at() instead of [].