PDA

View Full Version : 0xc0000005 error when using qVector



przemo
8th December 2010, 23:44
hello,
I've just started working with QT and wanted to test some core classes, before working with gui. However, even at this point I encountered difficulties. This is the code


#include <QtCore/QVector>

int main(int argc, char* argv[])
{
QVector<uchar> vector;
vector.push_back(30);

return 0;
}


Everything compiles fine. On runtime I get the following error:


The application failed to initialize properly (0xc0000005). Click OK to terminate


I noticed that it's a problem of QVector. QList, for example, works fine.
It's the same either both on debug an release.
IDE: Code-Blocks 10.05
compiler: mingw 4.5.0-1
QT 4.7.1 compiled for mingw

I'd be thankful for any help to this frustrating problem.

wysota
9th December 2010, 00:29
Read the message - your application didn't even start. c00(0...)5 is an access violation error. There is something messed up in your system - http://www.0xc0000005.com/

przemo
9th December 2010, 01:00
Thank You, but I've just solved it :)

I've seen this page already, but this is rather for people who generally have this error, no matter what application they are running.My problem was only with my own programs.

The solution was to compile program with mingw provided with qt, not the "general" one. If it was obvious - sorry for bothering.

wysota
9th December 2010, 09:57
I've seen this page already, but this is rather for people who generally have this error, no matter what application they are running.My problem was only with my own programs.
Are you serious? You think the solution is different depending on whether you are the author of the program or not?

przemo
9th December 2010, 13:44
Are you serious? You think the solution is different depending on whether you are the author of the program or not?

Yes, i'm serious. If this is Your conclusion, then i'm afraid i didn't make myself clear.
All i wanted to say is that in my case it was a problem with the compiler. After switching to mingw provided with qt, it worked. I don't know if this is right explanation, but now I can run this program.

wysota
9th December 2010, 14:02
Yes, i'm serious. If this is Your conclusion, then i'm afraid i didn't make myself clear.
All i wanted to say is that in my case it was a problem with the compiler. After switching to mingw provided with qt, it worked. I don't know if this is right explanation, but now I can run this program.

It was a problem with the dlls in your system. The point is it was not caused by using QVector instead of QList as your application didn't even manage to launch.