[Solved] Set environment variable for QT SDK (.dll file missing)

  • Hello all,

    I am a newb for QT , just downloaded the QT SDK for windows 7.
    It seems working fine when I debug any program from the IDE, but when I run any project exe (from release or debug folder) It shows message for so many .dll files are missing.

    I think I need to set some environment variables for it.
    I don't know what and how will I do it?
    If I am right then please let me know the settings for it. Or any other Ideas for the problem of .dll file missing.

    Thanks in advance


  • you can download the missing dll files and put it into qtsdk library directory.I think it may work.Ohterwise you can install latest version.

  • Moderators

    You are having problems running your code from the command line, is that correct?

    Check the run configuration creator uses (Projects->Run Settigns). There is a section there called "Run Environment", which shows the environment reator uses to run your applicaiton. Make sure your command line is using a similar environment. On windows the PATH variable is usually the most critical.

  • Thanks for the replies,

    Please suggest me to set the 'PATH and the variables'.

    Is there any specific variable which I need to create?
    I saw a similar kind of example on the internet, but don't know how practically I will do it?

    Well thanks again, I will try your suggestions . :)

  • How are you running your application ??

    By clicking the executable ?? Or from inside the SDK-> creator -> run itself?

  • As Tobias wrote PATH is most important. You can set it to bin directory in Qt installation directory (where all dlls sit). Ex. If you install Qt to c:\qt\4.8.2 then add c:\qt\4.8.2\bin to path.
    How to do that? Check "this":http://www.windows7hacker.com/index.php/2010/05/how-to-addedit-environment-variables-in-windows-7/

  • @Tobias and Rahul, I am running the programs from IDE(QT creator) by clicking the run and debug buttons(Working) but when I run the programs from the debug or release folder executable all go in vein.

    @Tobias,I have not tried it from command prompt, however I tried your suggestion and the environment is set to 'build environment'.

    @sidewinder, I have installed the QT SDK and below are the PATHs I have tried to set in the path variable, nothing worked (Suggest If I got it wrong and things are not like this):


    Please tell me if this is not the way to solve the issue:
    What have I missed ? Is there something wrong with my installation ? It is all set to the default locations and I haven't changed anything.

    Thanks for your efforts :)

  • bq. C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin;

    This one should work. Have you logout -> login after setting PATH? Restarting explorer process should also work. To be certain - reboot :).

  • So, what i understand is, Your application is working form within the SDK. But your executable is not finding the dlls when you try to run .

    If it is so, you might want to go through the" deployment documentation. ":http://doc.qt.nokia.com/4.7-snapshot/deployment-windows.html

    You might need to keep qtcore4.dll,qtgui4.dll in the folder folder where exe resides or set the library path in code.

    Or you can set the PATH variable to the Qt - dll folder.

  • Hey sidewinder and Rahul both suggestion worked.

    Thanks a lot :)

  • You're welcome :)

    Please edit the post-title as "Solved" :)

Log in to reply

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