Qt 5.2.1 MinGw 64-bit is not producing the right executable file



  • hello thanks for reading my post

    i have windows 7 64-bit installed with Qt MinGW 64-bit the compiler is working fine now with my 64bit libraries and when i run the project from Qt it runs perfectly there is no issues even on the debugging mode but the problem im facing is when i want to run the .exe file i end up with error message "The application was unable to start correctly (0xc00007b). Click Ok to close the application"
    and i have checked the executable file it's 64-bit file

    i hope somebody can help me with this thanks.



  • Hi, error 0xc000007b can occur because of a mixup of 64 and 32 bit DLLs.
    So even though your .exe file is 64 bit, it could be that the DLLs found in your PATH setting is 32 bit, for example libwinpthread-1.dll.

    One way around this problem, is to copy the 64 bit versions of the MinGW and Qt DLLs to the same directory as your .exe file.



  • [quote author="hskoglund" date="1396292744"]Hi, error 0xc000007b can occur because of a mixup of 64 and 32 bit DLLs.
    So even though your .exe file is 64 bit, it could be that the DLLs found in your PATH setting is 32 bit, for example libwinpthread-1.dll.

    One way around this problem, is to copy the 64 bit versions of the MinGW and Qt DLLs to the same directory as your .exe file.
    [/quote]

    thanks for the answer i copied the DLLS and it works....one question how can i make sure of the PATH and correct the paths so it can link to the right directory


  • Moderators

    This is the common case of PATH polluting. You should never put Qt in the PATH globally. You also can't expect your users to have Qt in PATH and you shouldn't modify it for them. Your IDE is doing that for you in the local process.
    As for the running it via clicking the .exe you need to distribute dlls with your app anyway so you can for example make copying them to the exe location part of your build process (eg. via custom step and robocopy).



  • Yeah, agree with Chris, to avoid "DLL Hell" on Windows, a good idea is to keep the .exe and the .dlls close together, if you want to run your app outside of QtCreator or on another PC.



  • [quote author="Chris Kawa" date="1396312336"]This is the common case of PATH polluting. You should never put Qt in the PATH globally. You also can't expect your users to have Qt in PATH and you shouldn't modify it for them. Your IDE is doing that for you in the local process.
    As for the running it via clicking the .exe you need to distribute dlls with your app anyway so you can for example make copying them to the exe location part of your build process (eg. via custom step and robocopy).[/quote]

    thank you


Log in to reply
 

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