Results 1 to 5 of 5

Thread: Exit Code 3

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    46
    Thanks
    4
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Exit Code 3

    Not sure if it's right board but it concerns Qt so... I got this code:
    Qt Code:
    1. // main.h
    2.  
    3. #include "ui.h"
    4.  
    5. class Main {
    6. public:
    7. Main()
    8. {
    9. }
    10.  
    11. void init() {
    12. ui.show();
    13. }
    14. private:
    15. UI ui;
    16. };
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. // main. cpp
    2.  
    3. #include "main.h"
    4. #include <QtGui/QApplication>
    5.  
    6. Main g_main;
    7.  
    8. int main(int argc, char *argv[])
    9. {
    10. QApplication a(argc, argv);
    11.  
    12. g_main.init();
    13.  
    14. return a.exec();
    15. }
    To copy to clipboard, switch view to plain text mode 

    And the problem is that creating g_main as a global variable gives me this:
    URL removed

    With some console errors:
    Qt Code:
    1. Invalid parameter passed to C runtime function.
    2. Invalid parameter passed to C runtime function.
    3. Exited with code 3
    To copy to clipboard, switch view to plain text mode 

    When I put Main g_main as a local variable into main() function then everything works fine. Moreover, in another project (without Qt) I have no such problem.

    I'm using Qt 4.7.0 with MingW.
    Last edited by wysota; 10th March 2011 at 23:54. Reason: removed URL

Similar Threads

  1. cannot exit from fullscreen
    By lazycoder in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2011, 06:38
  2. Is there a guide for exit code messages?
    By tonnot in forum Newbie
    Replies: 13
    Last Post: 9th December 2010, 10:45
  3. What means the "error n. 3" exit code?
    By glafauci in forum Qt Programming
    Replies: 0
    Last Post: 27th November 2010, 15:44
  4. Replies: 2
    Last Post: 21st November 2010, 18:03
  5. clean exit!!
    By Raajesh in forum Qt Programming
    Replies: 1
    Last Post: 17th June 2008, 16:33

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.