Exe Compiles and Runs within Qt Creator but not manualy opening the exe



  • I compiled a simple window that ran from compiling it within the Qt Creator. But upon manually opening the .exe in the target folder I was prompted an error:

    "the program can't start because Qt5Cored.dll is missing from your computer".

    Can anybody explain to me how to go about finding and loading this dll so as to make the application work?


  • Moderators

    welcome to devnet

    You ran into a very common problem.

    In "this post":http://qt-project.org/forums/viewthread/7392/#43411 the directories for searching dlls are nicely summarized.

    In case you have more than one version of Qt installed you need to check the toolchain you have used.

    Typically you can find all dlls for that tool chain find in the .../bin folder, where also qmake.exe can be found (atleast with Qt4 it is the case). In order to find out the required dlls, you may use the "dependency walker":http://www.dependencywalker.com/



  • Thanks, I hope to learn alot whilst here.

    Okay so I chose the path solution of the link you supplied. I accessed PATH of my computer (http://www.computerhope.com/issues/ch000549.htm#0) and selected the Bin directory of Qt dll's (http://qt-project.org/forums/viewthread/7392/#43411).

    It works.

    However what will I need to do if I want to PACKAGE this exe I made to another computer i.e. the end user?!

    I ran dependancy walker and like 10 dll's are reuqired. Must I then copy across all the dll's identified by dependancy walker into a file along with the exe to the end user?

    [quote author="koahnig" date="1362930638"]welcome to devnet

    You ran into a very common problem.

    In "this post":http://qt-project.org/forums/viewthread/7392/#43411 the directories for searching dlls are nicely summarized.

    In case you have more than one version of Qt installed you need to check the toolchain you have used.

    Typically you can find all dlls for that tool chain find in the .../bin folder, where also qmake.exe can be found (atleast with Qt4 it is the case). In order to find out the required dlls, you may use the "dependency walker":http://www.dependencywalker.com/
    [/quote]


  • Moderators

    [quote author="DeanQt" date="1362932281"]
    However what will I need to do if I want to PACKAGE this exe I made to another computer i.e. the end user?!

    I ran dependancy walker and like 10 dll's are reuqired. Must I then copy across all the dll's identified by dependancy walker into a file along with the exe to the end user?
    [/quote]
    The Qt dlls you need for sure. It depends on the complexity of your application which ones you require. For Qt 4 it was at least QtCore4, QtGui and some others. For checking out it is better is avoiding to have the dlls accessible through the path. I do not use the path option anymore. This makes sense especially if you may use other applications also replying on Qt dlls. You may up in inconsistencies for those applications. In addition, when you are experimenting with different compilers and or version (tool chains) it is better to use direct access only.

    Every compiler requires also a runtime dlls specific for this compiler. There are also a couple of system dlls loaded, which are available on every system. Checkout dependency walker. It is quite useful. It will tell also where it has found a specific dll.




Log in to reply
 

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