Results 1 to 7 of 7

Thread: Error when executing Qt application on Win7: possible issue with libstdc++-6.dll?

  1. #1
    Join Date
    Apr 2013
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Error when executing Qt application on Win7: possible issue with libstdc++-6.dll?

    I have a Qt project that is working well under Linux, and I am trying to run it under Windows 7 64 bit. I am using Qt 5.1.1 and mingw 4.8.

    In order to create the executable starting from the .pro file, I followed the subsequent steps:
    - run qmake.exe from directory Qt/5.1.1/mingw48_32/bin
    - run mingw32-make.exe from directory Qt/Tools/mingw48_32/bin
    - put all needed .dlls inside the folder with the freshly created .exe of my application. I took the .dlls from Qt/5.1.1/mingw48_32/bin. The libraries are:
    -- icudt51.dll
    -- icuin51.dll
    -- icuuc51.dll
    -- libstdc++-6.dll
    -- libwinpthread-1.dll
    -- Qt5Core.dll
    -- Qt5Gui.dll
    -- Qt5QWidgets.dll

    When I try to run my application, it crashes immediately with the following error:
    Problem signature:
    Problem Event Name: APPCRASH
    Application Name: ugp3-population-inspector.exe
    Application Version: 0.0.0.0
    Application Timestamp: 529b97e7
    Fault Module Name: libstdc++-6.dll
    Fault Module Version: 0.0.0.0
    Fault Module Timestamp: 516ee7b6
    Exception Code: c0000005
    Exception Offset: 00043f17
    OS Version: 6.1.7601.2.1.0.768.3
    Locale ID: 1036
    Additional Information 1: 3a5f
    Additional Information 2: 3a5f3876e9d420f8f9257cedd5068646
    Additional Information 3: 58bf
    Additional Information 4: 58bfe2891c811f25e4b9e96b50dd180b
    So, it looks like there is some trouble with libstdc++-6.dll...but I don't really understand the issue.

    Can anyone help me? Thanks in advance :-)

  2. The following user says thank you to sol_kanar for this useful post:

    louboutinoutlet (2nd December 2013)

  3. #2
    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: Error when executing Qt application on Win7: possible issue with libstdc++-6.dll?

    Qt Code:
    1. Exception Code: c0000005
    To copy to clipboard, switch view to plain text mode 
    Is "Access violation" as a quick Google search will tell you. The code is almost certainly accessing a zero, uninitialised, or already freed pointer.

    You also need to complete the deployment with the MingW runtime library (MINGWM10.DLL), "platforms/qwindows.dll" plugin for Windows, and the ANGLE related dlls (3 of them I think). Do that first as you will not get much further without them.
    http://qt-project.org/doc/qt-5.0/qtd...cation-package

  4. #3
    Join Date
    Apr 2013
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Error when executing Qt application on Win7: possible issue with libstdc++-6.dll?

    Thanks for your help!

    I've added all the .dlls, but I am still getting the same error.

    I tried to proceed in a different way: I loaded my .pro in Qt Creator, I cleaned/re-built it and I tried to run it from there...but again, I got the same error.

    EDIT: As a comparison, I also tried to run some programs from the "examples" folder in Qt/5.1.1, and Qt Creator was able to load, compile and execute them correctly.

    What could be the issue?
    Last edited by sol_kanar; 2nd December 2013 at 12:20.

  5. #4
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Error when executing Qt application on Win7: possible issue with libstdc++-6.dll?

    As a comparison, I also tried to run some programs from the "examples" folder in Qt/5.1.1, and Qt Creator was able to load, compile and execute them correctly.
    Yes, because these programs do not have any "Access violation" bugs. Run debug version of your project under debugger and post stack trace after the crash.

  6. #5
    Join Date
    Apr 2013
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Error when executing Qt application on Win7: possible issue with libstdc++-6.dll?

    Ok, I ran the Qt Center debugger, and here is what I got (see attached screenshot)

    "Level 0" in the window is libstdc++-6.dll inside the folder where the executable is.

    qt-error.jpg

  7. #6
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Error when executing Qt application on Win7: possible issue with libstdc++-6.dll?

    Can you post the content of main.cpp ? Line no. 12 in particular

  8. #7
    Join Date
    Apr 2013
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Error when executing Qt application on Win7: possible issue with libstdc++-6.dll?

    Qt Code:
    1. #include "ui_ugp3-population-inspector.h"
    2. #include "MicroGPMainWindow.h"
    3. #include "MicroGPApplication.h"
    4.  
    5. using namespace std;
    6. using namespace Ui;
    7.  
    8. // main
    9. int main(int argc, char* argv[])
    10. {
    11. // create application
    12. MicroGPApplication app(argc, argv);
    13. // create widget that will be used as anchor for the ugp3.ui interface
    14. QMainWindow* mainWindow = new QMainWindow;
    15. // create window class defined by the ugp3.ui file
    16. MicroGPMainWindow ugp3Window;
    17.  
    18. // bind window to widget
    19. ugp3Window.setupUi(mainWindow);
    20.  
    21. // show window
    22. mainWindow->show();
    23.  
    24. // return exit value of the application
    25. return app.exec();
    26. }
    To copy to clipboard, switch view to plain text mode 

    Here it is! Apparently, the program crashes when it tries to create a MicroGPApplication object (which is a class inherited from QApplication). Here is the code for the MicroGPApplication class (it's just a header file):

    Qt Code:
    1. #ifndef MICROGPAPPLICATION
    2. #define MICROGPAPPLICATION
    3.  
    4. #include <QtGui>
    5. #include <QApplication>
    6. #include <QMessageBox>
    7.  
    8. class MicroGPApplication : public QApplication
    9. {
    10. public:
    11. MicroGPApplication(int& argc, char ** argv) : QApplication(argc, argv) { }
    12. virtual ~MicroGPApplication() { }
    13.  
    14. // reimplemented from QApplication so we can throw exceptions in slots
    15. virtual bool notify(QObject * receiver, QEvent * event)
    16. {
    17. try
    18. {
    19. return QApplication::notify(receiver, event);
    20. }
    21. catch(std::exception& e)
    22. {
    23. QMessageBox::warning( 0, tr("An error occurred"), e.what() );
    24. }
    25.  
    26. return false;
    27. }
    28. };
    29.  
    30. #endif
    To copy to clipboard, switch view to plain text mode 


    Added after 22 minutes:


    Just a quick update: I finally managed to solve the issue. I have another system with Win7 64-bit, I just installed Qt 5.1.1 along with mingw 4.8, and - after a minor tweaking with the .pro - Qt Creator was able to successfully build and run the program.

    On the other system, I had a separate, different version of mingw already installed when I installed Qt 5.1.1; so, my guess is that there was some kind of issue between the two versions (and probably the folders of *both* were inside PATH).

    Thanks everyone for your help! :-)
    Last edited by sol_kanar; 2nd December 2013 at 17:15.

Similar Threads

  1. XP specific issue executing statically linked app
    By Mesozoic in forum Installation and Deployment
    Replies: 1
    Last Post: 27th November 2012, 22:37
  2. error while executing qt application
    By khadija123 in forum Qt Programming
    Replies: 1
    Last Post: 13th April 2012, 23:16
  3. Replies: 7
    Last Post: 15th November 2010, 10:00
  4. Error while executing a application - Gtk WARNING
    By augusbas in forum Qt Programming
    Replies: 1
    Last Post: 12th June 2010, 13:25
  5. QGLWidget, libstdc++ compilation error
    By Rayven in forum Qt Programming
    Replies: 3
    Last Post: 5th July 2006, 18:11

Tags for this Thread

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.