Application runs in Qt Creator, but not as an executable



  • When I run my program within Qt Creator, I get no errors, however when i try and use the executable created during the build process outside the creator, I get this error:

    The application was unable to start correctly (0xc000007b). Click OK to close the application.

    I am using mingw-w64 with Qt 4.7.4 and Qt Creator 2.4.1

    From what I have read online it seems that it is a 32/64 bit compatibility issue, and I am just unsure on how to fix it.


  • Moderators

    Check the environment Qt Creator uses to run your application: Projects->Run Settings, Run Enviromnent there.

    Make sure you have similar settings in the command line you run your application in. Most important is most likely to set PATH correctly, as that defines which libraries windows is going to see.



  • I checked the PATH environment variable, it has the locations of MinGW64 and msys, I am not sure what else it needs.

    I did notice that in the about dialog in Qt Creator it says that is based on Qt 4.7.4 (32 bit) maybe this could be a problem?


  • Moderators

    No, Qt Creator is shipped with its own Qt which is of version 4.7.4. That makes it harder to break creator when mucking around the Qts installed by the Qt SDK;-)

    Well, creator does not do any magic: It does set the working directory, the application, the command line arguments you set up and the environment as listed in the run settings and asks the OS to start the whole thing.



  • I figured it out! It was the PATH environment variable after all, I was missing something in my computers version that was in Qt Creators version.

    Thanks for your help



  • twf0001, would you mind telling me what was missing from your PATH?

    I'm having the same issue and the other solutions posted on this forum look downright scary! So I'd like to try your solution first.



  • I should have added that other than the Qt path ("C:\Dev\Qt\Qt5.0.2\5.0.2\msvc2012_64\bin") the Qt and Windows paths on my machine are identical.

    I can't imagine a deployed application being dependent on the location of Qt, so there must be another cause. I've already gathered together all of the Qt (and other) DLLs identified by Dependency Walker.

    I only upgraded to the VS 2012 64-bit toolkit last week and this is the first time I've tried to deploy my project as a 64-bit application. It was working under the old VS 2010 toolkit.

    I'm on a Windows 8 machine.



  • if you use 32 bit for app exe system, must build once that source code in 32 bit system


Log in to reply
 

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