Unable to Run a Qt project



  • Hello, i've installed QT 5.5.1 with MinGw, everything was fine, i've hopened QtCreator and made an empty project like this :

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QMainWindow>
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        MainWindow(QWidget *parent = 0);
        ~MainWindow();
    };
    
    #endif // MAINWINDOW_H
    
    #include "mainwindow.h"
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
    {
    }
    
    MainWindow::~MainWindow()
    {
    
    }
    
    
    #include "mainwindow.h"
    #include <QApplication>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        MainWindow w;
        w.show();
    
        return a.exec();
    }
    
    
    
    #-------------------------------------------------
    #
    # Project created by QtCreator 2015-12-11T18:07:48
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = test4
    TEMPLATE = app
    
    
    SOURCES += main.cpp\
            mainwindow.cpp
    
    HEADERS  += mainwindow.h
    
    

    As u can see, it's a totally clean project.
    If i hit "Compile" it works without any kind of problem, but as soon as i hit "run" button Qt Crashes....any idea?
    Thanks

    Note :
    OS : Windows 10


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What do you get if you run your application through the debugger ?



  • The gdb process has not responded to a command within 40 second(s). This could mean it is stuck in an endless loop or taking longer than expected to perform the operation.
    You can choose between waiting longer or aborting debugging.
    

    Updata : noticed that when Qt freeze before the crash, Explorer.exe freexes and crash too.

    
    03:00:29: Running steps for project test4...
    03:00:29: Configuration unchanged, skipping qmake step.
    03:00:29: Starting: "C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe" 
    C:/Qt/Qt5.5.1/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'C:/Users/Gianmarco/Documents/build-test4-Desktop_Qt_5_5_1_MinGW_32bit-Debug'
    g++ -Wl,-subsystem,windows -mthreads -o debug\test4.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o  -lmingw32 -LC:/Qt/Qt5.5.1/5.5/mingw492_32/lib -lqtmaind -lshell32 -lQt5Widgetsd -lQt5Guid -lQt5Cored 
    C:/Qt/Qt5.5.1/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot open output file debug\test4.exe: Permission denied
    collect2.exe: error: ld returned 1 exit status
    Makefile.Debug:81: recipe for target 'debug\test4.exe' failed
    mingw32-make[1]: *** [debug\test4.exe] Error 1
    mingw32-make[1]: Leaving directory 'C:/Users/Gianmarco/Documents/build-test4-Desktop_Qt_5_5_1_MinGW_32bit-Debug'
    makefile:34: recipe for target 'debug' failed
    mingw32-make: *** [debug] Error 2
    03:00:30: The process "C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project test4 (kit: Desktop Qt 5.5.1 MinGW 32bit)
    When executing step "Make"
    03:00:30: Elapsed time: 00:01.
    

  • Lifetime Qt Champion

    Any chance of having an anti-virus running ?



  • @SGaist Yeah maybe, anyway i've fixed it by installing Linux... and no, i'm not kidding. Thanks anyway


  • Lifetime Qt Champion

    Certain anti-virus are pretty protective when there are new executables created on the file system so they directly put in on quarantine.

    Switching OSes is also a good solution :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.