Results 1 to 5 of 5

Thread: exited with code -1073741819

  1. #1
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Unhappy exited with code -1073741819

    im currently working with qt and have linked an external program to my qt project.
    I want to display the output of my external program on compile output area as well.

    so the code is as follow. After QT finished compiling, I run the project, and from compile area i can see it goes to "zou can see from the debug area....."
    while the qt program just crashed, with warning : .....exited with code -1073741819
    void myProject::Project(){
    QObject *parent= 0;
    QProcess *myProcess = new QProcess (parent);
    connect(myProcess, SIGNAL(finished(int)), SLOT(playPause()));
    qDebug() << connect(myProcess, SIGNAL(readyReadStandardError()), this, SLOT(updateError()));
    qDebug() << connect(myProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(updateText()));
    myProcess->start("./sampledata/externalprogram.exe")
    qDebug()<< "you can see from the debug area how he is running.";

    }

    void myProject::updateError(){
    QByteArray data = myProcess->readAllStandardError();
    qDebug()<< data;
    }

    void myProject::updateText(){
    QByteArray data = myProcess->readAllStandardOutput();
    qDebug()<< data;
    }


    anybody help ?

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: exited with code -1073741819

    comment this line and run again
    Qt Code:
    1. //myProcess->start("./sampledata/externalprogram.exe")
    To copy to clipboard, switch view to plain text mode 
    if the program still exits, then the problem is in external program.

    also is better to do this
    Qt Code:
    1. ...
    2. QProcess *myProcess = new QProcess(this);
    3. ...
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: exited with code -1073741819

    If I had a dollar for every time...

    This particular error has been addressed quite a few times in these forums.
    -1073741819 = 0xC0000005 = Access violation.

    You are looking for things like using uninitialized or NULL pointers in your code, calling delete on something that wasn't allocated on the heap, calling delete twice etc.

    Nothing obvious sticks out in the bit of code you have posted (except that your QProcess is a memory leak).
    Last edited by ChrisW67; 11th November 2011 at 06:15.
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

  4. #4
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: exited with code -1073741819

    thanks for both of you.

    i did search here and there were similar problem before.

    just dont get them at the first time.

    hope it works in this time

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: exited with code -1073741819

    Qt Code:
    1. void myProject::Project(){
    2. QObject *parent= 0;
    3. QProcess *myProcess = new QProcess (parent);
    4. connect(myProcess, SIGNAL(finished(int)), SLOT(playPause()));
    5. qDebug() << connect(myProcess, SIGNAL(readyReadStandardError()), this, SLOT(updateError()));
    6. qDebug() << connect(myProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(updateText()));
    7. myProcess->start("./sampledata/externalprogram.exe")
    8. qDebug()<< "you can see from the debug area how he is running.";
    9.  
    10. }
    11.  
    12. void myProject::updateError(){
    13. QByteArray data = myProcess->readAllStandardError();
    14. qDebug()<< data;
    15. }
    16.  
    17. void myProject::updateText(){
    18. QByteArray data = myProcess->readAllStandardOutput();
    19. qDebug()<< data;
    20. }
    To copy to clipboard, switch view to plain text mode 
    The problem is that in line 3, you define "myProcess" as a local variable within your Project() method. You then try to use it in lines 13 and 18 to read data. As written, this code should not even compile, because "myProcess" is not defined in the two slot methods. Since it does compile and run apparently you have also defined it as a member variable of your myProject class, but in the Project() method, the local variable has scope precedence over the class member variable, so as far as the two slots are concerned, "myProcess" is an uninitialized pointer and thus causes the access violation.

    Please use CODE tags when posting source code.

Similar Threads

  1. exe exited with code -1073741819
    By bajoelkid12 in forum Newbie
    Replies: 7
    Last Post: 2nd November 2011, 08:05
  2. exe exited with code -1073741819
    By szisziszilvi in forum Newbie
    Replies: 10
    Last Post: 1st September 2011, 16:55
  3. exited with code -1073741819
    By Con Nít in forum Newbie
    Replies: 7
    Last Post: 27th January 2011, 22:04
  4. Replies: 3
    Last Post: 2nd November 2010, 22:36
  5. exited with code -1073741819 error
    By arpspatel in forum Qt Programming
    Replies: 8
    Last Post: 2nd March 2010, 09:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.