Searching dependent dlls
-
Hi everybody,
i made a programm with qtcreator and everything works fine if I run it (out of qtcreator). But if I buld it (release mode) and try to start the exe from hard drive, some dlls are missing.
So I go and find one dll after another, but I never found all. I also downloaded a programm called "dependancy walker" which analysed dependencys and needed dlls. I tryed all dlls I found on my hard drive dependency walker suggest, but no dll seems to be valid.Is there a way to find the dlls which qtcreator uses?
Best thing would be if qtcreator could copy all needed dlls in the release folder during the build process.Thanks,
Nobody -
If you are on Windows, then use:
"Dependency Walker":http://www.dependencywalker.com/And on Linux, "ldd" will help...
-
[quote author="Nobody-86" date="1364333458"]
So I go and find one dll after another, but I never found all. I also downloaded a programm called "dependancy walker" which analysed dependencys and needed dlls. I tryed all dlls I found on my hard drive dependency walker suggest, but no dll seems to be valid.
[/quote]I recommend you to read the documentation about "deployment of Qt apps to Windows and shared libraries":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html. There are tips and examples how to link, create the app package and deploy it on Windows.
-
So, I tried to find all dlls with the help of dependency walker, unfortuntly with no success. It looks like there are dlls missing "in" the QT5CORE.dll, which are (dependency walker can't find them):
@
API-MS-WIN-CORE-COM-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
API-MS-WIN-SHCORE-SCALING-L1-1-0.DLL
DCOMP.DLL
GPSVC.DLL
IESHIMS.DLL
@
I can not finde these dlls anywhere on my harddrive.There are also some "error looking" icons (red window) next to:
@
c:\windows\system32\API-MS-WIN-CORE-THREADPOOL-L1-1-0.DLL
c:\windows\system32\OLE32.DLL
c:\windows\system32\DWMAPI.DLL
c:\windows\system32\IEFRAME.DLL
c:\windows\system32\IMM32.DLL
c:\windows\system32\MFPLAT.DLL
c:\windows\system32\NDFAPI.DLL
c:\windows\system32\USERENV.DLL
c:\windows\system32\UXTHEME.DLL
@
I am not exactly sure what this mean.If I try start my aplication it says:
"Microsoft Visual C++ Runtime Library
This aplication has requested the Runtime to terminate it in an unsusual way.
Please contact the application's support team for more information."So, why does it says Microsoft Visual C++? I don't have Visual Studio.
-
Those System DLL's belong to the operating system and you don't need to redistribute them. Actually, installing those on another system probably wouldn't work, because system DLL's are specific to the operating system (version). Don't even try that!
BTW: You will notice that most system DLL's actually are in C:\Windows\WinSxS and those in "System32" are just hard-links.
-
Actually pretty much all applications use the C Runtime libraries, those compiled with Visual Studio use the MSVCRT???.DLL that ships with the individual version of Visual Studio. And apps compiled with MinGW/GCC use MSVCRT.DLL, i.e. the one that is part of the Windows operating system.
Anyway, your error message "This aplication has requested the Runtime to terminate it in an unsusual way" does NOT mean the application doesn't start. It means the application did start, but it crashed. Time for debugging...
-
Ok, after exiting troubleshooting I finally solved it. For some reason, a directory "platforms" with a "qwindows.dll" inside is needed in the place where the *.exe is located. I have no idea why, and dependency walker does not tell it.
Would be nice if there is anybody who can explain me why this is needed, and why this isn't mentioned anywhere.
-
...because Dependency Walker can only show DLL dependencies in the static import tables of EXE/DLL files. It can not know beforehand (for obvious reasons) which DLL's are going be loaded by the application via "LoadLibrary()":http://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85) at runtime, as is the case with the Qt plug-in DLL's! However Dependency Walker has a useful "Profiling" feature which executes the program and then monitors which DLL's are loaded at runtime...
If you want a complete list of all DLL's that are currently loaded by a running process, use Process Explorer:
http://technet.microsoft.com/de-de/sysinternals/bb896653.aspx(Enable "show lower pane" and set "lower pane view" to "DLLs", then select the desired process from above)
--
About Qt plug-in DLL's, please have a look at:
http://qt-project.org/doc/qt-4.8/plugins-howto.html#locating-plugins -
I've got the same problem as described in this post, and can't get the release version to run. It runs perfectly in debug. But there is a problem that my application ask for ms visual c++ runtime, and i use mingw for to compile. I have tried installing the vcredist that is in qt5.1.1 but it still doesn't run.
-
I had the same problem - the app didn't run without Qt installation libriaries in qt dir, so it didn't work on other computers, and it didn't work if I renamed the QT install dir on the dev computer and so made it unavailable. I tried Dependancy Walker, Process Explorer and deployqt.exe, all bullshit and not comfortably working out of the box. Actually not giving any result.
The fastest way to find app dependancies happened to become just renaming directories in Qt install dir to make them unavailable for the app. In 5 minutes I found out that my app needed ..\mingw482_32\qml\QtQuick\Window.2 and qml\QtQuick.2 directories, which I coppied to my app folder like that - myappfolder\QtQuick\Window.2 and myappfolder\QtQuick.2.
It became a hundred times faster than seaching and learning the wierd tools.
Maybe it can help someone. )