Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't run or debug my project

Can't run or debug my project

Scheduled Pinned Locked Moved General and Desktop
14 Posts 4 Posters 4.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hamdi
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hamdi
      wrote on last edited by
      #2

      http://prntscr.com/4t2ukm (screenshot)

      1 Reply Last reply
      0
      • hskoglundH Offline
        hskoglundH Offline
        hskoglund
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hamdi
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • hskoglundH Offline
            hskoglundH Offline
            hskoglund
            wrote on last edited by
            #5

            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?

            1 Reply Last reply
            0
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • H Offline
                H Offline
                hamdi
                wrote on last edited by
                #7

                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]

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  hamdi
                  wrote on last edited by
                  #8

                  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]

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Hi,

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

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • hskoglundH Offline
                      hskoglundH Offline
                      hskoglund
                      wrote on last edited by
                      #10

                      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!)

                      1 Reply Last reply
                      0
                      • H Offline
                        H Offline
                        hamdi
                        wrote on last edited by
                        #11

                        (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]

                        1 Reply Last reply
                        0
                        • H Offline
                          H Offline
                          hamdi
                          wrote on last edited by
                          #12

                          iam sorry for that :(

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Sorry for what ?

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • H Offline
                              H Offline
                              hamdi
                              wrote on last edited by
                              #14

                              sorry for messing with my SysWOW64 :)

                              1 Reply Last reply
                              0

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved