Issue while making release 64 bits with VS2015



  • Hi,

    I wrote a software with VS2015 and Qt5.6.1.
    It runs perfectly with VS2015 in debug mode 64 bits.
    When I choose Release 64 bits and I run the exe out of VS2015, I permanently get the error :

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

    What could it be ?

    Many thanks.



  • Hi, 0xc000007b means that there's a mixup of 32-bit and 64-bit dlls, for example MSVCP140.dll, VCRUNTIME140.dll or ucrtbase.dll are loaded incorrectly from C:\Windows\Syswow64 and not from C:\WIndows\System32. It could be you have something in your %PATH% that does this.



  • Many thanks.
    I don't see such things in my path variable.
    I use Windows 10.



  • Ok, but perhaps you have 2 installations of Qt? One 32-bit and 64-bit?

    Edit: you could try downloading Dependency Walker, load your .exe file into and then press F7 to start profiling: in the trace window you should be able see what .dll is the culprit.



  • This piece of software is amazing !
    Here is the result:

    Started "ADIS SCOREGEN.EXE" (process 0x24C4) at address 0x00007FF67ED80000.  Successfully hooked module.
    Loaded "NTDLL.DLL" at address 0x00007FFEDA9E0000.  Successfully hooked module.
    Loaded "KERNEL32.DLL" at address 0x00007FFEDA930000.  Successfully hooked module.
    Loaded "KERNELBASE.DLL" at address 0x00007FFED7B80000.  Successfully hooked module.
    DllMain(0x00007FFED7B80000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "KERNELBASE.DLL" called.
    DllMain(0x00007FFED7B80000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "KERNELBASE.DLL" returned 1 (0x1).
    DllMain(0x00007FFEDA930000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "KERNEL32.DLL" called.
    DllMain(0x00007FFEDA930000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "KERNEL32.DLL" returned 1 (0x1).
    Injected "DEPENDS.DLL" at address 0x000000005A4C0000.
    DllMain(0x000000005A4C0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "DEPENDS.DLL" called.
    DllMain(0x000000005A4C0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "DEPENDS.DLL" returned 1 (0x1).
    Loaded "APPHELP.DLL" at address 0x00007FFED57F0000.  Successfully hooked module.
    DllMain(0x00007FFED57F0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "APPHELP.DLL" called.
    DllMain(0x00007FFED57F0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "APPHELP.DLL" returned 1 (0x1).
    Loaded "SHELL32.DLL" at address 0x00007FFED80B0000.  Successfully hooked module.
    Loaded "MSVCRT.DLL" at address 0x00007FFEDA140000.  Successfully hooked module.
    Loaded "CFGMGR32.DLL" at address 0x00007FFED7250000.  Successfully hooked module.
    Loaded "WINDOWS.STORAGE.DLL" at address 0x00007FFED7530000.  Successfully hooked module.
    Loaded "QT5CORE.DLL" at address 0x000000005B570000.  Successfully hooked module.
    Loaded "QT5XLSXD.DLL" at address 0x00007FFEB9350000.  Successfully hooked module.
    Unloaded "QT5CORE.DLL" at address 0x000000005B570000.
    Loaded "QT5GUI.DLL" at address 0x000000005B0A0000.  Successfully hooked module.
    Unloaded "QT5GUI.DLL" at address 0x000000005B0A0000.
    BasepIsRemovableMedia: Host device is removable, Shim cache deactivated
    Loaded "COMBASE.DLL" at address 0x00007FFED9950000.  Successfully hooked module.
    Loaded "RPCRT4.DLL" at address 0x00007FFED9830000.  Successfully hooked module.
    Loaded "BCRYPTPRIMITIVES.DLL" at address 0x00007FFED7D70000.  Successfully hooked module.
    Loaded "QT5CORE.DLL" at address 0x000000005B570000.  Successfully hooked module.
    Unloaded "QT5CORE.DLL" at address 0x000000005B570000.
    Loaded "QT5GUI.DLL" at address 0x0000000058EE0000.  Successfully hooked module.
    Unloaded "QT5GUI.DLL" at address 0x0000000058EE0000.
    Loaded "QT5WIDGETS.DLL" at address 0x000000005B120000.  Successfully hooked module.
    Loaded "ADVAPI32.DLL" at address 0x00007FFEDA330000.  Successfully hooked module.
    Unloaded "QT5WIDGETS.DLL" at address 0x000000005B120000.
    Loaded "SECHOST.DLL" at address 0x00007FFED9D90000.  Successfully hooked module.
    Loaded "QT5WIDGETS.DLL" at address 0x000000005B5A0000.  Successfully hooked module.
    Unloaded "QT5WIDGETS.DLL" at address 0x000000005B5A0000.
    Exited "ADIS SCOREGEN.EXE" (process 0x24C4) with code -1073741701 (0xC000007B).
    
    

    What I don't understand is for example:

    Loaded "QT5GUI.DLL" at address 0x000000005B0A0000.  Successfully hooked module.
    Unloaded "QT5GUI.DLL" at address 0x000000005B0A0000.
    

    So sometimes the dll is correctly loaded and after is not loaded.

    I had placed the following dlls in the same folder as my exe:

    Qt5core.dll
    Qt5Cored.dll
    Qt5Gui.dll
    Qt5Guid.dll
    Qt5Widgets.dll
    Qt5Xlsx.dll
    Qt5Xlsxd.dll
    
    


  • Perhaps it could be a problem with VS Redistribuable .
    Microsoft Visual C++ 2015 Redistribuable 32 and 64 bits is already installed.
    I don't know ...



  • I have a lot of errors in the window above the trace window:

    Error opening file. The system cannot find the file specified (2)..
    Some filenames start with : API-MS-WIN-CORE- ... or API-MS-WIN-SERVICE- ... ........



  • @mulfycrowh don't worry about those filenames API-MS-WIN-xxx, they are just dummy filenames that are not really used (they are a naming trick Microsoft uses to keep track of what .dll to use for different Windows versions)

    About those Qt5Core.dll etc. that you placed in the same folder as your .exe file, did you copy them manually, perhaps from C:\Qt\Tools\QtCreator\bin? That would explain the 0xc000007b error.

    To copy the correct Qt5xxx.dlls you can use windeployqt



  • You're right. I copied the dlls and it's the reason for the issue.
    I added C:\Qt\Qt5.6.1\5.6\Src\qttools\bin to the PATH, where windeployqt.exe is.
    Then opened a command prompt and then go to the folder where I have the .exe for my app.
    But then I don't know.
    It's first time I deploy ...

    Many thanks for your help.



  • windeployqt is quite easy to use, if you first clean your folder from any of those bad Qt5xxx.dlls, then open a comand prompt, cd to where your .exe is then type:
    C:\Qt\Qt5.6.1\5.6\Src\qttools\bin\windeployqt "ADIS SCOREGEN.EXE"

    If your app is a Qt widget app that's usually sufficient to get all the necessary files copied, if not you can search this forum, there's lot of info on windeployqt.



  • I did as you told.
    I got the error:

    Unable to query qmake: CreateProcessW failed: The system cannot find the file specified



  • I added the path where I have qmake.exe.
    Now I got an other error:

    Unable to find dependent libraries of C:\Qt\Qt5.6.1\5.6\msvc2015_64\bin\Qt5Xlsxd.dll ...

    For sure because the dll is in C:\QtXlsx\lib.



  • I copied Qt5Xlsxd.dll in C:\Qt\Qt5.6.1\5.6\msvc2015_64\bin which is not correct for me but it allows the process to start.
    I've got the error:

    lconvert.exe - Application Error

    The application was unable to start correctly (0xc000007b) ...

    BUT
    BUT

    When I launched my exe it runs.
    I noticed the file vcredist_v64.exe.

    Is it OK to get such error about lconvert.exe ?



  • on another computer it doesn't run because Qt5Guid.dll missing.
    It hasn't been written onto the folder ...



  • Hi, Qt5Guid.dll is a .dll for Debug builds, and if you're testing on another computer, best is to always build your app in Release mode. (Also some problem I think for Qt5Xlsxd.dll, instead of Qt5Xlsx.dll.)



  • @hskoglund Hi ! Great you're back because in big trouble.
    What do I get the error with Iconvert.ex?. So windeployqt doesn't finish the job. It should explain the troubles.



  • Hi. lconvert.exe it's a Qt program just like yours, so if it gets the same error 0xc000007b then perhaps it also is because of the same problem (some 32-bit Qt5xxx.dlls copied from Qt Creator's bin directory)?



  • @hskoglund I don't think so because I deleted everything in the folder, except the exe.



  • Finally I got it perfectly running. Here is what I did:

    1/ In VS2015, I fixed Properties > Linker > Input depending on the version debug or release. Previously I had added both Qt5Xlsxd.dll and Qt5Xlsx.dll for both versions. So now, one dll for one version.
    2/ I fixed my environment variables. I had added a few folders and that wasn't good. Now I only add C:\Qt\Qt5.6.1\5.6\msvc2015_64\bin (where you get qmake.exe and windeployqt.exe).

    Then I open a command window, cd to the folder where the exe is.
    The type : windeployqt .

    AND IT PERFECTLY RUNS ! No more error with Iconvert.exe !

    THAT'S ALL FOLKS !

    THANK YOU AGAIN FOR YOUR HELP !


Log in to reply
 

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