Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Release Build, Missing VCRUNTIME and MSVCP .dll ERROR (msvc2015/17)



  • MAIN ISSUE: Executes inside QtCreator but not standalone executable in release folder

    I am attempting to make my project/executable run outside of the qtcreator so I can run it on external machines.

    It compiles under Debug/Release version, however when I navigate to the directories they are compiled in they fail to run stating

    "System Error - Code execution cannot proceed..... VCRUNTIME140_APP.dll was not found"
    Also
    "System Error - Code execution cannot proceed..... MSCVCP140_APP.dll was not found"

    Upon inserting these .dll 's into the directory with the executable, it doesn't produce the missing errors and the program 'loads' but fails to display anything.

    Usually at this stage it would also display missing Qt5Gui.dll etc as well which is where I would run windepolyqt.exe and it would usually work however even after trying to run windepolyqt and inserting the missing .dll s it still fails to run.

    I've also tried to execute it directly with qtcreator_process_stub.exe but it still produces the same missing .dll errors.

    I've changed my Run Environment settings to clean and inside QtCreator it executes fine, if I change "Add build library search path to PATH" to unticked the program runs/crashes and fails to display anything.

    I'm using MSVC2017 32bit, I've tried MSVC2015 32bit and it executes find inside QTCreator but same errors occur when trying to execute it directly from debug/release folder.

    I've tried reinstalling vc_redist.x86.exe as well but alas nothing.

    I've managed to get this to get QtApplications to run outside of QtCreator before but this time I'm not sure where I am going wrong.

    I've looked at similar forum question but can't quite get it to work with mine, Any help would be greatly appreciated.

    I've also included a picture of my build settings, dependency walker and my QT environment variable path.

    https://imgur.com/a/GLMN6gw


  • Qt Champions 2019

    @MarkCorrigan42 said in Release Build, Missing VCRUNTIME and MSVCP .dll ERROR (msvc2015/17):

    I am attempting to make my project/executable run outside of the qtcreator so I can run it on external machines.

    Use windeployqt instead fiddling around what you need by yourself.


  • Lifetime Qt Champion

    Hi
    Make sure to use
    --compiler-runtime Deploy compiler runtime (Desktop only).



  • If you use CMAKE you can add this to get them CMakeLists.txt :

    if (MSVC)
        message("Use Visual Studio MSVC")
        # Visual Studio
        set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP true)
        include(InstallRequiredSystemLibraries)
        file(COPY ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION .)
    endif()
    

    it will copy these two libs for you when running cmake, sorry I don know equivalent for qmake.



  • @Christian-Ehrlicher

    I said previously I've tried using windeployqt with "windeployqt.exe --quick --no-translations ." but the error still persists

    @mrjj

    I've tried it with the --compiler-runtime tag but it gives mes "Deployment of the compiler runtime is implemented for Desktop only."

    @Gulivert

    unfortunately I'm using qmake, is there a similar solution with that?


  • Qt Champions 2019

    Use Dependency Walker or similar (e.g Dependencies) to see what's ging wrong here. You either mix different architectures (32/64 bit) or different Qt versions.


  • Moderators

    @MarkCorrigan42
    you're most likely using QML, and did not specify your own(created) *.qml files via -qmldir


Log in to reply