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. Error -1073741819
Forum Update on Monday, May 27th 2025

Error -1073741819

Scheduled Pinned Locked Moved General and Desktop
34 Posts 3 Posters 15.2k Views
  • 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.
  • D Offline
    D Offline
    dwsld
    wrote on last edited by
    #1

    Why when I create a basic app I get this error : -1073741819
    mainwindow.cpp
    @#include "mainwindow.h"
    #include "ui_mainwindow.h"

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

    MainWindow::~MainWindow()
    {
    delete ui;
    }
    @
    main.cpp

    @#include "mainwindow.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec&#40;&#41;;
    

    }
    @

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MuldeR
      wrote on last edited by
      #2

      This means your application has crashed, probably ACCESS VIOLATION or similar.

      Your code looks good so far, but that isn't everything, I guess...

      My OpenSource software at: http://muldersoft.com/

      Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

      Go visit the coop: http://youtu.be/Jay...

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SetBetterPass
        wrote on last edited by
        #3

        This code seems to be ok but have you run qmake?
        If so what line and file is the error referring to? And what is in mainwindow.h header?

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dwsld
          wrote on last edited by
          #4

          this is in mainwindow.h
          @#ifndef MAINWINDOW_H
          #define MAINWINDOW_H

          #include <QMainWindow>

          namespace Ui {
          class MainWindow;
          }
          @

          And i use this for sys root C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin
          @
          class MainWindow : public QMainWindow
          {
          Q_OBJECT

          public:
          explicit MainWindow(QWidget *parent = 0);
          ~MainWindow();

          private:
          Ui::MainWindow *ui;
          };

          #endif // MAINWINDOW_H
          @

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dwsld
            wrote on last edited by
            #5

            I use this for sys root C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MuldeR
              wrote on last edited by
              #6

              Your code looks okay too me. Please make a Debug build and run it in a Debugger for more details?

              BTW: What does the "explicit" keyword do there?

              My OpenSource software at: http://muldersoft.com/

              Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

              Go visit the coop: http://youtu.be/Jay...

              1 Reply Last reply
              0
              • D Offline
                D Offline
                dwsld
                wrote on last edited by
                #7

                segment fault at line 98 in qgenericatomic.h

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  MuldeR
                  wrote on last edited by
                  #8

                  None of the code excerpts you posed has 98 lines...

                  Please post the complete code where it crashes or at least look what line 98 is and post that part!

                  And if it doesn't crash in your own code, go up in the call stack until you reach your own code...

                  My OpenSource software at: http://muldersoft.com/

                  Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

                  Go visit the coop: http://youtu.be/Jay...

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    dwsld
                    wrote on last edited by
                    #9

                    @...
                    template <typename T> static inline always_inline
                    T load(const T &_q_value) Q_DECL_NOTHROW
                    {
                    return _q_value;
                    }
                    ...@

                    [Edit: Please wrap code in @ tags. Thanks. -- mlong]

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      MuldeR
                      wrote on last edited by
                      #10

                      Is that your code or Qt code?

                      I guess it's Qt code? If so, please go backwards in the call stack, starting from the function where it crashed, up to the last function that was still in your code. That would be the place to have a look...

                      (That's because, most likely, the problem is not in the Qt code where it finally crashed, but in your code that passed wrong/invalid arguments to some Qt function or that tried to call a method on an uninitialized Qt object)

                      My OpenSource software at: http://muldersoft.com/

                      Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

                      Go visit the coop: http://youtu.be/Jay...

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        dwsld
                        wrote on last edited by
                        #11

                        I can`t even debug it.Yes it is Qt code.I think that i have not configure the Qt right .Is there a step by step method?

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          dwsld
                          wrote on last edited by
                          #12

                          Now I am 100% sure that I am not configured the Qt right because even with the examples I get the same error.

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            MuldeR
                            wrote on last edited by
                            #13

                            [quote author="dwsld" date="1363506638"]I can`t even debug it.[/quote]

                            Why ???

                            --

                            [quote author="dwsld" date="1363506638"]Yes it is Qt code.[/quote]

                            As said before, just because it crashed in Qt code, this does not necessarily mean the reason for the crash is in Qt code too. Actually, it is more likely that the reason for the crash is in your own code.

                            For example, if you call a Qt function that takes a pointer to an object of some type, but you pass a NULL pointer (maybe accidentally), then the app will crash in the Qt function - at the place where it tries to dereference the pointer you have passed. So it did crash in Qt code. But the problem that caused the crash, obviously, is in not the Qt code! It is in your code. You never should have passed a NULL pointer where a pointer to an object was required. There are of course many more examples how you can make Qt code crash by using it wrongly...

                            --

                            [quote author="dwsld" date="1363506638"]I think that i have not configure the Qt right .Is there a step by step method?[/quote]

                            What exactly do you mean with "not configure the Qt right"?

                            Did you build Qt yourself or do you use the pr-compiled Qt libraries?

                            Think you didn't even mention which platform you are on...

                            My OpenSource software at: http://muldersoft.com/

                            Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

                            Go visit the coop: http://youtu.be/Jay...

                            1 Reply Last reply
                            0
                            • D Offline
                              D Offline
                              dwsld
                              wrote on last edited by
                              #14

                              Windows 7.I have downloaded this:http://releases.qt-project.org/qt5/5.0.1/qt-windows-opensource-5.0.1-mingw47_32-x86-offline.exe

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                MuldeR
                                wrote on last edited by
                                #15

                                So you did not configure + build Qt yourself, but just use the pre-compiled DLL's, right?

                                If so, I don't see how you could have configured is wrongly, as you never did (or needed to) configure it.

                                BTW: Did you read all of my above post(s), especially the part about the stack trace ???

                                My OpenSource software at: http://muldersoft.com/

                                Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

                                Go visit the coop: http://youtu.be/Jay...

                                1 Reply Last reply
                                0
                                • D Offline
                                  D Offline
                                  dwsld
                                  wrote on last edited by
                                  #16

                                  How to get the stack trace?

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    MuldeR
                                    wrote on last edited by
                                    #17

                                    [quote author="dwsld" date="1363518510"]How to get the stack trace?[/quote]

                                    That depends on the IDE/Debugger you use, of course.

                                    But if you run a Debug build, inside a Debugger, and then a "crash" occurs, the Debugger will usually trigger a break and then show you where it crashed, including a complete stack trace...

                                    --

                                    Should look like this:
                                    http://i.imgur.com/YNSYMVi.jpg

                                    From the call stack in this very simple example we can see that it crashed in the fclose() function, from C++ runtime library. But if we go up in the stack trace (only one step in this example), we see that the call came from someFunction() in my own code. And that's exactly where we'll find the actual reason for the crash...

                                    My OpenSource software at: http://muldersoft.com/

                                    Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

                                    Go visit the coop: http://youtu.be/Jay...

                                    1 Reply Last reply
                                    0
                                    • D Offline
                                      D Offline
                                      dwsld
                                      wrote on last edited by
                                      #18

                                      http://postimage.org/image/lypykxatz/

                                      1 Reply Last reply
                                      0
                                      • M Offline
                                        M Offline
                                        MuldeR
                                        wrote on last edited by
                                        #19

                                        [quote author="dwsld" date="1363522510"]http://postimage.org/image/lypykxatz/[/quote]
                                        So what happens in the "main_win.cpp" at line 131, which I guess is the only code of yours?

                                        My OpenSource software at: http://muldersoft.com/

                                        Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

                                        Go visit the coop: http://youtu.be/Jay...

                                        1 Reply Last reply
                                        0
                                        • D Offline
                                          D Offline
                                          dwsld
                                          wrote on last edited by
                                          #20

                                          As i said this is not my code this is from one example - analog clock

                                          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