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. Cannot run Qt example in Qt creator: The program has unexpectedly finished
Forum Updated to NodeBB v4.3 + New Features

Cannot run Qt example in Qt creator: The program has unexpectedly finished

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 3 Posters 5.4k 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.
  • J Offline
    J Offline
    JakeW
    wrote on last edited by JakeW
    #1

    Recently I tried to upgrade Qt to 5.8.0 on Windows 7 32bit from Qt5.6.2 MSVC 2013, and I saw strange issues.

    I downloaded and installed Visual Studio 2015 from this link: https://www.visualstudio.com/downloads/

    After I installed Qt 5.8.0 MSVC 2015 version, Qt Creator 4.2.1 can be launched. From the welcome page, I selected the example named: "Address Book Example". And then after clicking "Configure" project, the project is listed in Qt Creator.

    Now I tried to build the project, which was successful. But when I tried to run the project, I got the following error messages:

    Starting C:\Qt\Examples\Qt-5.8\widgets\itemviews\build-addressbook-Desktop_Qt_5_8_0_MSVC2015_32bit-Debug\debug\addressbook.exe...
    The program has unexpectedly finished.
    C:\Qt\Examples\Qt-5.8\widgets\itemviews\build-addressbook-Desktop_Qt_5_8_0_MSVC2015_32bit-Debug\debug\addressbook.exe crashed.
    

    I didn't see this kind of error before when I was using Qt5.6.2 with MSVC 2013. I also tried the following things:

    • Reinstall Qt5.8.0 MSVC 2015 using offline installer
    • Reinstall Qt5.7.1 MSVC 2015 using offline installer
    • Reinstall Qt5.6.2 MSVC 2015 using offline installer
    • Reinstall Qt5.8.0 using online installer, in which I chose MSVC 2013 and MSVC 2015

    I still kept getting the same error messages.

    When I went to the debug folder, double clicked the exe file, it said some Qt dlls were missing. I then manually copied to the debug folder, then the exe can be run with no problem.

    Now I want to run app from inside Qt Creator, but not sure what is the issue with Qt Creator 4.2.1. I researched in Google for a few hours, but still cannot find out the reason why Qt Creator cannot run projects even it's own Example projects. (same errors for my own projects)

    I feel it must be something to do with Qt creator environment/settings. Anyone has any ideas about this problem?

    Update 1:

    I tried to use MinGW with Qt Creator, the addressbook example can be run correctly. Looks like the crashing issue is related to MSVC 2015. I need MSVC 2015, because all other environments don't support webenginewidgets, and I got:

    :-1: error: Unknown module(s) in QT: webenginewidgets

    Not sure if the crashing issue is a bug in Qt or Qt creator.

    Update 2:

    In my Qt Creator, I saw warning icons for MSVC 2013 and MSVC 2015 compilers, please see the screenshots below:
    enter image description here
    enter image description here

    jsulmJ 1 Reply Last reply
    0
    • J JakeW

      Recently I tried to upgrade Qt to 5.8.0 on Windows 7 32bit from Qt5.6.2 MSVC 2013, and I saw strange issues.

      I downloaded and installed Visual Studio 2015 from this link: https://www.visualstudio.com/downloads/

      After I installed Qt 5.8.0 MSVC 2015 version, Qt Creator 4.2.1 can be launched. From the welcome page, I selected the example named: "Address Book Example". And then after clicking "Configure" project, the project is listed in Qt Creator.

      Now I tried to build the project, which was successful. But when I tried to run the project, I got the following error messages:

      Starting C:\Qt\Examples\Qt-5.8\widgets\itemviews\build-addressbook-Desktop_Qt_5_8_0_MSVC2015_32bit-Debug\debug\addressbook.exe...
      The program has unexpectedly finished.
      C:\Qt\Examples\Qt-5.8\widgets\itemviews\build-addressbook-Desktop_Qt_5_8_0_MSVC2015_32bit-Debug\debug\addressbook.exe crashed.
      

      I didn't see this kind of error before when I was using Qt5.6.2 with MSVC 2013. I also tried the following things:

      • Reinstall Qt5.8.0 MSVC 2015 using offline installer
      • Reinstall Qt5.7.1 MSVC 2015 using offline installer
      • Reinstall Qt5.6.2 MSVC 2015 using offline installer
      • Reinstall Qt5.8.0 using online installer, in which I chose MSVC 2013 and MSVC 2015

      I still kept getting the same error messages.

      When I went to the debug folder, double clicked the exe file, it said some Qt dlls were missing. I then manually copied to the debug folder, then the exe can be run with no problem.

      Now I want to run app from inside Qt Creator, but not sure what is the issue with Qt Creator 4.2.1. I researched in Google for a few hours, but still cannot find out the reason why Qt Creator cannot run projects even it's own Example projects. (same errors for my own projects)

      I feel it must be something to do with Qt creator environment/settings. Anyone has any ideas about this problem?

      Update 1:

      I tried to use MinGW with Qt Creator, the addressbook example can be run correctly. Looks like the crashing issue is related to MSVC 2015. I need MSVC 2015, because all other environments don't support webenginewidgets, and I got:

      :-1: error: Unknown module(s) in QT: webenginewidgets

      Not sure if the crashing issue is a bug in Qt or Qt creator.

      Update 2:

      In my Qt Creator, I saw warning icons for MSVC 2013 and MSVC 2015 compilers, please see the screenshots below:
      enter image description here
      enter image description here

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @JakeW You should try to debug. But first you need to install Microsoft debugger: http://doc.qt.io/qtcreator/creator-debugger-engines.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • O Offline
        O Offline
        Oleksandr Malyushytskyy
        wrote on last edited by
        #3

        The problem is mostly likely in your configuration,

        For example I doubt you could use GDB to debug MVC generated code.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          JakeW
          wrote on last edited by
          #4

          Hi @jsulm and @Oleksandr-Malyushytskyy thanks for your reply.

          I installed Microsoft Windows SDK debugging tools, and configure with Qt Creator, and tried to debug. I put a breakpoint in the first line of main method. But it didn't reach that point at all. The debugger simple quit immediately.

          I assume after a complete installation of Qt 5.8.0 and MSVC 2015, I should be able to run Examples without any custom configurations. But the example couldn't be run with 'crashed' messages. Maybe Windows 7 32bit is too old, and no tests against this operating system for latest Qt releases?

          I'm trying to setup Qt 5.8.0 with MSVC 2015 on Windows 10 and see how it works.

          1 Reply Last reply
          0
          • O Offline
            O Offline
            Oleksandr Malyushytskyy
            wrote on last edited by
            #5

            If main it is not reached it is typically a sign of incompatible runtime libraries (for example different CRTs, mix of the libraries built with different compilers. etc.

            J 1 Reply Last reply
            0
            • O Oleksandr Malyushytskyy

              If main it is not reached it is typically a sign of incompatible runtime libraries (for example different CRTs, mix of the libraries built with different compilers. etc.

              J Offline
              J Offline
              JakeW
              wrote on last edited by
              #6

              @Oleksandr-Malyushytskyy I was able to run the exe manually from the debug folder after I copied dlls over.

              So I guess my system may have multiple runtime libraries, and Qt Creator found the wrong one? Perhaps I should clean everything and try reinstalling?

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JakeW
                wrote on last edited by JakeW
                #7

                I finally resolved the issue. The reason is that the Windows 10 SDK is missing.

                After I download and install all default components of the Windows 10 SDK, everything worked on Windows 7 32bit.

                1 Reply Last reply
                1
                • O Offline
                  O Offline
                  Oleksandr Malyushytskyy
                  wrote on last edited by
                  #8

                  This was probably required by Qt binaries you installed,

                  J 1 Reply Last reply
                  0
                  • O Oleksandr Malyushytskyy

                    This was probably required by Qt binaries you installed,

                    J Offline
                    J Offline
                    JakeW
                    wrote on last edited by
                    #9

                    @Oleksandr-Malyushytskyy Yes possibly. Could be Qt WebEngine.

                    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