Can't run or debug my project



  • hello guys this my second question today ! -_-
    and this time it is a problem which is i can't debug my project and can't run it and get this error in the picture
    [ Starting C:\Users\Mamdoh\Documents\build-untitled2-Desktop_Qt_5_1_1_MinGW_32bit-Debug\debug\untitled2.exe...
    The program has unexpectedly finished.
    C:\Users\Mamdoh\Documents\build-untitled2-Desktop_Qt_5_1_1_MinGW_32bit-Debug\debug\untitled2.exe exited with code -1073741701 ] !http://prntscr.com/4t2ukm(error)!
    and i didn't miss with any thing i dont know what is the problem i reinstalled Qt many times and it stills give me that
    notice :
    iam a new programer ... so please guys tell me how to fix it easily :D





  • Hi, have you added any C++ code to your mainwindow.cpp? If so, please show it, might be a bug in there :-)



  • no no it is fine the code is fine as the program runs and then quit immeditly
    and here is the code :)
    @#include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include "sstream"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);

    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    void MainWindow::on_pushButton_clicked()
    {
    double m,h,r;
    std::ostringstream ss (std::ostringstream::ate);

      h=ui->lineEdit->text().toDouble();
      m=ui->lineEdit_2->text().toDouble();
    
    
      r=h*3600+m*60;
    
      ss.str("shutdown -s -t ");
    
      ss << r;
    
    
      system&#40;ss.str(&#41;.c_str());
    

    }

    void MainWindow::on_pushButton_2_clicked()
    {
    system("shutdown -a");
    }@

    thanks for reply



  • Hi, does it crash directly, or when you click on a button?
    If it doesn't crash directly, does it crash when you click on button 1 or 2 or both?


  • Moderators

    One of the reasons this error can occur is when you mess up the dynamically linked libraries and, as your previous question was about deployment, I assume you might have.
    Make sure you put everything in the right place, including platform plugins, compiler runtime libs etc. Also make sure you didn't put debug dlls in release folder or the other way around.
    If you installed Qt from online installer check that you copied the right compiler runtime. Qt online installer can install several versions of MinGW. Make sure you used the right one (the one used to compile the Qt package you're using).

    You can use "Dependency Walker":http://www.dependencywalker.com in "profile mode" to track what dll your app is missing and can't find.



  • it doesn't even open i don't see the (mainWindow) at least
    [quote author="hskoglund" date="1412460750"]Hi, does it crash directly, or when you click on a button?
    If it doesn't crash directly, does it crash when you click on button 1 or 2 or both?[/quote]



  • yeah i thought so , the problem because i copied some DLLs in SysWOW64 and iam sorry for that ! :(
    and actualy i installed 2 versions of Qt yesterday and itmight be the cause of the problem too but i uninstalled every thing about Qt and installed it again and still get the error
    i will try to search more and act carefuly and i promise i will not miss up with the dangerous data , wish me luck :)

    [quote author="Chris Kawa" date="1412465911"]One of the reasons this error can occur is when you mess up the dynamically linked libraries and, as your previous question was about deployment, I assume you might have.
    Make sure you put everything in the right place, including platform plugins, compiler runtime libs etc. Also make sure you didn't put debug dlls in release folder or the other way around.
    If you installed Qt from online installer check that you copied the right compiler runtime. Qt online installer can install several versions of MinGW. Make sure you used the right one (the one used to compile the Qt package you're using).

    You can use "Dependency Walker":http://www.dependencywalker.com in "profile mode" to track what dll your app is missing and can't find.[/quote]


  • Lifetime Qt Champion

    Hi,

    To add to my fellows, copy the dll's from Qt's path not form Qt Creator



  • Also what you can do, as a sanity check on your system:
    try creating an empty Qt Widgets Application (don't add any C++ code or other stuff) and see if it runs ok.
    If it does not, take a big piece of paper and write on it 1000 times: "I shall not copy any DLLs to SysWOW64 or from Qt Creator"!! (just kidding!)



  • (agree) :D :D :D :D
    [quote author="hskoglund" date="1412549231"]Also what you can do, as a sanity check on your system:
    try creating an empty Qt Widgets Application (don't add any C++ code or other stuff) and see if it runs ok.
    If it does not, take a big piece of paper and write on it 1000 times: "I shall not copy any DLLs to SysWOW64 or from Qt Creator"!! (just kidding!)
    [/quote]



  • iam sorry for that :(


  • Lifetime Qt Champion

    Sorry for what ?



  • sorry for messing with my SysWOW64 :)


Log in to reply
 

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