Probably your qt build is corrupt i think. I closely looked at QApplication constructor and it uses
int reference for argc parameter. I dont know whether this is the problem or not but can you tell me where it crashes if you try the below program.
int main(int argc, char *argv[])
{
int k = argc + 1;
int l = argc;
//also try QApplication(l, argv);
return 0;
}
int main(int argc, char *argv[])
{
int k = argc + 1;
int l = argc;
QApplication app(argc, argv);
//also try QApplication(l, argv);
return 0;
}
To copy to clipboard, switch view to plain text mode
Also pay attention to this qapplication doc
Initializes the window system and constructs an application object with argc command line arguments in argv.
Warning: The data pointed to by argc and argv must stay valid for the entire lifetime of the QApplication object.
The global qApp pointer refers to this application object. Only one application object should be created.
This application object must be constructed before any paint devices (including widgets, pixmaps, bitmaps etc.).
Note that argc and argv might be changed. Qt removes command line arguments that it recognizes. The original argc and argv can be accessed later with arguments().
Bookmarks