[Solved] Set environment variable for QT SDK (.dll file missing)
-
wrote on 1 Sept 2012, 10:22 last edited by
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
Zain
-
wrote on 1 Sept 2012, 14:39 last edited by
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.
-
wrote on 1 Sept 2012, 18:50 last edited by
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.
-
wrote on 3 Sept 2012, 05:55 last edited by
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 . :)
-
wrote on 3 Sept 2012, 09:52 last edited by
How are you running your application ??
By clicking the executable ?? Or from inside the SDK-> creator -> run itself?
-
wrote on 3 Sept 2012, 10:24 last edited by
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/ -
wrote on 3 Sept 2012, 12:25 last edited by
@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):
C:\MinGW\bin;
C:\QtSDK\QtCreator\bin;
C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin;
C:\QtSDK\Madde\bin;
C:\QtSDK\QtCreator\bin;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 :)
-
wrote on 3 Sept 2012, 12:29 last edited by
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 :).
-
wrote on 3 Sept 2012, 12:35 last edited by
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.
Edit:
Or you can set the PATH variable to the Qt - dll folder. -
wrote on 4 Sept 2012, 11:57 last edited by
Hey sidewinder and Rahul both suggestion worked.
Thanks a lot :)
-
wrote on 5 Sept 2012, 06:07 last edited by
You're welcome :)
Please edit the post-title as "Solved" :)
8/11