Im compiling a simple qt program with mingw and it crashes on qapplication and I cannot figure out why?
I have tried debug and release libraries manually setting the argc and argv which I believe its getting hung up on thats the only variables qt is getting but no matter what I do it has the same issue. I have also tried different qt versions everywhere from 5.0.0 to 5.2 with no change.
Heres my source
#include <iostream>
#include <Qt>
#include <QCoreApplication>
#include <QApplication>
#include <QtWebKitWidgets/QWebView>
#include <QtWebKitWidgets/QWebFrame>
#include <QImage>
#include <QWebPage>
int main(int argc, char** argv){
std::cout << "here1" << std::endl;
std::cout << "argc: " << argc << std::endl;
QApplication app(argc, argv);
std::cout << "here2" << std::endl;
QWebView* view = new QWebView();
std::cout << "here3" << std::endl;
view->resize(800,600);
view->load(QUrl("http://www.google.com"));
view->show();
return app.exec();
}
Heres how its compiled
i686-w64-mingw32-g++ -Ofast -Wall -o test/testwin32.exe test.cpp -static-libgcc -static-libstdc++ -lgdi32 -lopengl32 -lglu32 -lws2_32 -lpdh -lpsapi -Wl,-rpath='$ORIGIN/',-rpath='.',-rpath='../',-rpath='resources/win32/qtwebkit/',-rpath='./resources/win32/qtwebkit/' -I./5.0.1/mingw47_32/include -I./5.0.1/mingw47_32/include/QtWidgets -I./5.0.1/mingw47_32/include/QtCore -I./5.0.1/mingw47_32/include/QtGui -I./5.0.1/mingw47_32/include/QtWebKitWidgets -I./5.0.1/mingw47_32/include/QtWebKit -I./5.0.1/mingw47_32/include/QtWidgets -L./5.0.1/mingw47_32/bin -L./5.0.1/mingw47_32/lib -lQt5WebKitWidgetsd -lQt5Quickd -lQt5PrintSupportd -lQt5OpenGLd -lQt5WebKitd -lQt5Qmld -lQt5Widgetsd -lQt5Guid -lQt5Networkd -lQt5Cored
Heres the output
here1
argc: 1
Unhandled page fault on read access to 0x0090b000 at address 0x6b9fe768 (thread 0009), starting debugger...
Heres the debugger details
Unhandled exception: page fault on read access to 0x0090b000 in 32-bit code (0x6b9fe768).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
EIP:6b9fe768 ESP:006bfba8 EBP:006bfba8 EFLAGS:00010202( R- -- I - - - )
EAX:0090b000 EBX:00153528 ECX:021bf680 EDX:00000000
ESI:00000052 EDI:001103b0
Stack dump:
0x006bfba8: 006bfc48 6b9470ac 0090b000 021bf680
0x006bfbb8: 79f4a2a0 7bc4b7b9 00000000 00000000
0x006bfbc8: feedbab1 00000001 00000000 00000000
0x006bfbd8: 00000000 00000001 00000000 001395e4
0x006bfbe8: 006bfce8 649453ce 6b9f23cc 6bae0880
0x006bfbf8: 006bfc30 6b947171 006bfbb0 00153520
000c: sel=0067 base=00000000 limit=00000000 32-bit --x
Backtrace:
=>0 0x6b9fe768 qCopy<char**, char**>+0x8(begin=0x90b000, end=0x21bf680, dest=0x79f4a2a0) [Q:\qt5_workdir\w\s\qtbase\src\corelib/../../include/QtCore/../../src/corelib/tools/qalgorithms.h:81] in qt5cored (0x006bfba8)
1 0x6b9470ac QCoreApplicationPrivate+0x173(this=0x153528, aargc=0x6bfd58, aargv=0x6bfd80, flags=0x1530d0) [Q:\qt5_workdir\w\s\qtbase\src\corelib/kernel/qcoreapplication.cpp:338] in qt5cored (0x006bfc48)
2 0x08554553 QGuiApplicationPrivate+0x28(this=0x153528, argc=0x6bfd58, argv=0x6bfd80, flags=0x1530d0) [Q:\qt5_workdir\w\s\qtbase\src\gui/kernel/qguiapplication.cpp:418] in qt5guid (0x006bfc78)
3 0x00915865 QApplicationPrivate+0x28(this=0x153528, argc=0x6bfd58, argv=0x6bfd80, flags=0x1530d0) [Q:\qt5_workdir\w\s\qtbase\src\widgets/kernel/qapplication.cpp:157] in qt5widgetsd (0x006bfca8)
4 0x00916181 QApplication+0x32(this=0x390, argc=0x6bfd58, argv=0x6bfd80, _internal=0x1530d0) [Q:\qt5_workdir\w\s\qtbase\src\widgets/kernel/qapplication.cpp:537] in qt5widgetsd (0x006bfce8)
5 0x0046fbe4 in testwin32 (+0x6fbe3) (0x006bfd78)