Hi, I am confused by this problem. When I run my application, a Runtime Error occurs. The following is my main.cpp
User and UserDB are two classes I write.Code:
#include "userDB.h" #include "manager.h" #include "user.h" #include <QApplication> #include <QTextCodec> #include <QPixmap> UserDB users; //所有已经注册的用户 User currentUser; //当前用户 QPixmap noDishImage; //comment this line, it works fine int main(int argc, char *argv[]) { Manager w; w.show(); return a.exec(); }
Why declaring global variables of my own classes the application works fine, while declaring a blobal variable of the QPixmap leads the application to crash??
Any ideas appreciated!!