[Solved] The program has unexpectedly finished



  • Greetings to all

    I am newcomer to this forum and I'm starting to learn Qt. I'm using the book "C + + GUI Programming with Qt 4 'as a text guide ... excellent book.

    I am testing a sample application that appears in the book (The spreadsheet described that shows up between chapters 3 and 4). I'm using QtCreator and although there is no error in the code (the application is built perfectly), when starting the execution, nothing happens, then the IDE puts the following message:

    The program has unexpectedly finished.
    C:\Users\PROYECTO\Desktop\mainwindow\debug\mainwindow.exe exited with code -1073741819

    In what is the error code -1073741819?...Is QtCreator error, an error of the operating system or application code?. I searched the internet and I could not find any description.

    If anyone knows of any possible reason or explanation of what might be happening would greatly appreciate it.


  • Moderators

    That is no error code from Qt creator. It is actually the return code from the application you have built.
    The error code can be found for quite a number of different threads by google. See for instance "this":http://www.qtcentre.org/threads/45777-exited-with-code-1073741819
    Without knowing the example it will be hard to help you. However, apparently, you might have a pointer problem (accessing non-allocated memory). Probably the best is to step with the debugger through the application and find the spot where the problem occurs.



  • In most cases I remember this as a problem with the application not finding a dll that has bin linked into. Have a look at the libs, this will probably solve the problem.



  • Excuse my ignorance, but not sure I understand ... You mean the libraries included in the source files or libraries of Qt?

    If it is the latter case it is not exactly what I look for and / or do ... I have no idea


  • Moderators

    Do you get an additional error message?



  • This is exactly what appears on the bottom panel of QtCreator when I run the program:

    Starting C:\Users\PROYECTO\Desktop\mainwindow\debug\mainwindow.exe...

    The program has unexpectedly finished.

    C:\Users\PROYECTO\Desktop\mainwindow\debug\mainwindow.exe exited with code -1073741819


  • Moderators

    franku suggested that there might be a problem with the libraries and dlls. I am not sure if this might be the case. I am rarely using Qt creator on windows.

    Did you compile another and run another small examples successfully before?

    If yes, it should be most likely in the current application. Probably best when you are posting the code.

    If no, try to create a small example first and see, if it is the environment.



  • I've run several sample applications before it. Run the examples that appear within the chapters 1 and 2 of the book (C + + GUI Programming with Qt 4) and several modifications that I did the same ... always work correctly either from QtCreator or building and running directly from the console using qmake


  • Moderators

    You need to compile your application in debug mode and run in debug mode. It will allow you to step through the code see where it is crashing.

    Did you debug already? If not, try to get familiar with the steps and what you can do. Some information for "debugging with tthe creator.":http://qt-project.org/wiki/QtCreatorWhitepaper#da7d763aac39b294c7453c77c10d8239



  • thanks ... I will try that



  • I recently resumed working with Qt and started to get familiar with using the debugger. I managed to find the problem in my application, certainly a problem of pointers (a variable of type 'QAction *' uninitialized). I corrected it and now the application works perfectly.

    Thank you all for your comments, support and suggestions.



  • Please could someone explain how to label this thread / discussion as 'solved'.

    Thanks again


Log in to reply
 

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