The application was unable to start correctly (0xc0000142)



  • Strange thing is that until today I didn't get this error. I also have to mention that I get this error if I compile with msvc2013 (both 32 or 64) , but not with MinGW. However for my project I need to be able to compile with msvc2013.

    This error is not related to my source code, because I tried other Qt apps, like a simple window app , even those examples that come with Qt leading to the same result.

    When I compile (debug or release) using Qt creator 3.3.0 I receive the following error :
    The application was unable to start correctly (0xc0000142)
    !http://i.imgur.com/48MHSK4.png(error)!

    The weird thing is that actually the application window opens in the background, if I click OK the windows closes and then the project build a new window without the error.

    I can work with this error, but it's annoying and I'm curious what's causing this error.
    I'm using Windows 7 SP1

    Thanks



  • Hi, 0xc0000142 is STATUS_DLL_INIT_FAILED, i.e. some DLL couldn't be loaded, to see which one, you can use "Dependency Walker":http://www.dependencywalker.com/
    Start it, open your Qt App, and then start profiling your Qt App with F7 key. The trace might show which DLL gives that error.



  • You might be missing the Visual Studio runtime libraries for 2013 on the computer you are running.

    "Visual C++ Redistributable Packages for Visual Studio 2013 ":http://www.microsoft.com/en-ca/download/details.aspx?id=40784



  • [quote author="hskoglund" date="1422393558"]Hi, 0xc0000142 is STATUS_DLL_INIT_FAILED, i.e. some DLL couldn't be loaded, to see which one, you can use "Dependency Walker":http://www.dependencywalker.com/
    Start it, open your Qt App, and then start profiling your Qt App with F7 key. The trace might show which DLL gives that error.
    [/quote]

    The error I get is when I try to compile the source code using Qt Creator.
    Somehow tries to compile 2 times. First time it gives me this error, but still compiles the app, after I click ok closes the app and re-compiles again , this time without error.
    If I start the app separately (double click the exe), everything works ok.

    [quote author="Rondog" date="1422394233"]You might be missing the Visual Studio runtime libraries for 2013 on the computer you are running.

    "Visual C++ Redistributable Packages for Visual Studio 2013 ":http://www.microsoft.com/en-ca/download/details.aspx?id=40784

    [/quote]

    Thanks I had redistributable packages for 2012, I've installed those for 2013 but I still get this error.



  • Could this be a Qt error? I have the latest version 5.4 and I realized that this error occur only when I'm using
    @QApplication app(argc, argv);@
    If I try to compile one of this qt quick example everything works ok:
    @QtQuickControlsApplication app(argc, argv);@



  • I see, the error occurs not in your app but when building/compiling it in Qt Creator. And only for Widgets-flavored Qt apps (i.e. with a QApplication in their main.cpp).

    If you do a Build/Clean All in Qt Creator and start your app again (to force a rebuild) and look in Qt Creator's Compile Output window (you can switch to it with ALT+4) and then do the same for a Quick Controls app, are there any differences?


Log in to reply
 

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