PDA

View Full Version : Imediate Program Crash



Corny
15th November 2016, 18:58
I hope this is the correct forum for this subject. I believe that this is probably an installation problem.
I recently upgraded to 5.7.0 from Qt 4.7.4 and I was having some problems. I did not remove 4.7.4 prior to installing 5.7 so I thought that might be causing the problem. I uninstalled both versions and then re-installed version 5.7. This is the environment I'm now attempting to run in...

OS: Windows 7 – Service Pack 1
System: 64 bit Operating System
IDE: Qt Creator 4.1.0
Qt Version: Qt 5.7.0
Compiler: MinGW 5.3.0 32 bit
nMake: Using jom instead of nMake

I attempted to build a quick bare-bones program from Qt Creator to test the install. It built just fine but when I went to run it, or run a debug version, the program would crash immediately. In debug, I set several breakpoints, including the first line and execution wasn't even reaching the first line of code. Running several of the provided example programs gave the same result.

I have searched the internet extensively and have not found a solution, or any one else experiencing a similar problem.

Thank you in advance if anyone can provide some insight on this problem.

Following are the details along with the bare-bones code that I first experienced the problem with.

Debugger
0x401a8055push%ebp
0x401a81<+0x0001> b920584000mov$0x405820,%ecx
0x401a86<+0x0006> 89e5mov %esp,%ebp
0x401a88<+0x0008> eb14jmp 0x401a9e<_pei386_runtime_relocator+30>
0x401a8a<+0x000a> 8db600000000lea0x0(%esi),%esi
0x401a90<+0x0010> 8b5104mov0x4(%ecx),%edx
0x401a93<+0x0013> 8b01mov (%ecx),%eax
0x401a95<+0x0015> 83c108add$0x8,%ecx
0x401a98 <+0x0018> 01 82 00 00 40 00 add %eax,0x400000(%edx)
0x401a9e<+0x001e> 81f968584000cmp$0x405868,%ecx
0x401aa4<+0x0024> 72eajb0x401a90<_pei386_runtime_relocator+16>
0x401aa6<+0x0026> 5dpop%ebp
0x401aa7<+0x0027> c3ret
0x401aa8<+0x0028> 90nop
0x401aa9<+0x0029> 90nop
0x401aaa<+0x002a> 90nop
0x401aab<+0x002b> 90nop
0x401aac<+0x002c> 90nop
0x401aad<+0x002d> 90nop
0x401aae<+0x002e> 90nop
0x401aaf <+0x002f> 90 nop

Compile Output:
08:06:24: Running steps for project WhatTheHell...
08:06:24: Configuration unchanged, skipping qmake step.
08:06:24: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe"
C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/..path…/build-WhatTheHell-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
mingw32-make[1]: Nothing to be done for 'first'.
mingw32-make[1]: Leaving directory 'C:/…path…/build-WhatTheHell-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
08:06:24: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
08:06:24: Elapsed time: 00:01.


Stack:
1 _pei386_runtime_relocator 0x4018d4
2 __mingw_CRTStartup 0x401212
3 WinMainCRTStartup 0x4012a8

Application Output:
Starting C:\...path…\debug\WhatTheHell.exe...
C:\...path…\WhatTheHell.exe exited with code 255
_____________________________________________
Main.cpp


#include"hellwindow.h"
#include<QApplication>

intmain(intargc,char*argv[])
{
QApplication a(argc,argv);

HellWindow w;
w.show();
return a.exec();
}

_____________________________________________
Hellwindow.h



#ifndefHELLWINDOW_H
#defineHELLWINDOW_H

#include<QMainWindow>
#include<QStandardItem>

namespaceUi {
classHellWindow;
}

classHellWindow:publicQMainWindow
{
Q_OBJECT

public:
explicitHellWindow(QWidget*parent=0);
~HellWindow();

privateslots:
voidon_hellBtn_clicked();

private:
Ui::HellWindow*ui;
};
#endif//HELLWINDOW_H

_____________________________________________
hellwindow.cpp



#include"hellwindow.h"
#include"ui_hellwindow.h"

HellWindow::HellWindow(QWidget*parent) :
QMainWindow(parent), ui(newUi::HellWindow)
{
ui->setupUi(this);
}

HellWindow::~HellWindow()
{
deleteui;
}

voidHellWindow::on_hellBtn_clicked()
{
ui->hellViewWidget->addItem("GoToHell");
}

_____________________________________________
WhatTheHell.pro


#-------------------------------------------------
#
#ProjectcreatedbyQtCreator####-##-#####:##:##
#
#-------------------------------------------------
QT += coregui
greaterThan(QT_MAJOR_VERSION, 4) : QT += widgets
TARGET = WhatTheHell
TEMPLATE = app
SOURCES += main.cpp\
hellwindow.cpp
HEADERS += hellwindow.h
FORMS += hellwindow.ui

d_stranz
15th November 2016, 23:11
ui->hellViewWidget->addItem("GoToHell");

I guess the Qt runtime finds your program to be offensive.

My other guess is that you don't have the Qt 5 and/or mingw DLLs in your system path so the runtime isn't finding them at startup.

Corny
16th November 2016, 14:25
Thank you d_stranz for your reply.

Your correct, perhaps the code may be offensive to some. So I burned some candles and performed some chants and deeply apologized to the Qt run-time.

Actually I have since uninstalled all Qt items and reinstalled an older version (4.8.3) and I'm giving that a go. However as soon as I get past this little time critical issue, I'm planning on attempting another try at 5.7 and I will ensure that the Qt 5 and MinGW DLL's are in my system path.

Thanks again for your assistance, I truly appreciate it.