tags:

views:

235

answers:

4

When I run the program from IDE (VS2008) it works perfectly. When I want to launch it from Windows Commander it doesn't work because it needs DLL that wasn't found. Used both debug and release builds.

+1  A: 

Make sure the Qt DLL's are in your PATH. Two simple solutions are:

  • Copy Qt's DLL's to your EXE's directory.
  • Copy Qt's DLL's to %WINDOWS%\System32 (e.g. C:\WINDOWS\System32) (possibly unsafe, especially if you install another versions of Qt system-wide. Also, requires administrative privilages).
strager
thanks a lot, now it`s OK!
chester89
I recommend do not copy to system32, just put to the application root directory. strager's #2
abatishchev
Or add the directory where the DLLs are located to your PATH
andreas buykx
abatichev is right. Copying to system32 can invite all kinds of trouble.
Shmoopty
Thanks for the note, abatishchev. I've edited my answer to note that.
strager
A: 

You should make sure that the DLLs needed by the executable (probably QT Dlls) are in the PATH or in the same directory as the executable. You can find which dlls are needed by using depends.exe

shoosh
A: 

another solution would be to place path to qt bin subdir in VS tools->options->projects and solutions->VC++ directories.

Jacek Ławrynowicz
A: 

You could link it statically with all the libraries it needs. Saves messing around with DLLs and stuff. On the down side, you can't update DLLs on your installed PCs to get updated/improved/fixed functionality, and will need to rebuild and redeploy.

So whether or not this is viable depends on what your installation targets are - a few PCs controlled by you, or every man+dog who decides to download your program?

Statically compiling in a library bug (security hole for example) and shipping that to your clients would be very poor form. Doing the same on a secure corporate intranet may make it worth doing just so that you know that each install is running exactly the same.

Rodyland