Export executable program from QtCreator - c++

I want to export an executable program from Qtcreator, the program works fine inside the Qtcreator but outside I got an error message, "missing QT5CORED.DLL" so I add it to the binary file but it keeps asking for other dependencies.

You need to put that dll in the executable folder. The dll would be in the Qt folder i assume, check it.
Also please note that is a debug dll (the last D in the name), you‘d want to ship a release build instead of a debug one.

You can find necessary QT dll's in: QT Directory \mingw48_32\bin
and windows runtime dll's in: QT Directory \mingw48_32\plugins\platforms
path is for mingw compiler

Related

Qt Creator can't find library files in the search path

When I compile the release target, everything is built correctly and I can run the program via windows explorer (the install script copies all the libraries to the .exe folder).
The problem that I am having, is that the program does not run inside QtCreator (in both debug and release) unless I manually copy the libraries to the .exe folder. This was not how it used to work but somehow, since I upgraded to Qt6 and start to use mingw instead of vc++, this behaviour started to happen.
There is an option in the project tab to "Add build library search to the PATH" that apparently is intended for exactly this reason (sip copying the libraries every time we compile), but somehow this is not working. I see the PATH change in the Environment form, but the program just crashes on loading with a "This application was unable to start correctly". If I copy the libraries and try again, it works.
So it turns out that it can't find just the onnxruntime.dll library. I assume that it has trouble finding any library that does not start with lib from the path. My solution for now was to copy just this file to the .exe folder.

DLL's dependency cannot be found when DLL moved to another location

I'm on Windows 10, Visual Studio 2017, x64 build . . .
I have a DLL that I'm using in an exe project. We'll call it, myLibrary.dll. It comes with a .lib companion file as well. The myLibrary.dll has some other DLL dependencies that it is using. We'll call that one theDependency.dll.
I've linked the companion myLibrary.lib file in my project through Linker --> General --> Additional Library Dependencies properties. Added myLibrary.lib to the Additional Dependencies.
When I build my project, I use post build event to copy the myLibrary.dll to the Release/Debug directory of my project.
This works fine.
My issue is when I try to use myLibrary.dll in a different exe project. I get an error that it cannot find the theDependency.dll. I've used all the same property setup as the first exe project. As a test, I moved the build directory of the first exe project to another location (on the same computer) and I get the same error. "Cannot find theDependency.dll"
How is myLibrary.dll targeting it's dependencies? Not sure why the 2nd project gets this error? Also, not sure why moving the files gets this error?
Any ideas? Thanks.
Adding the path of the dll to the PATH environment variable worked for me.

Qt C++ Missing DLLs

I created a simple notepad file using Qt.
The program does run when in Qt creator.
However, when I navigate to the debug folder, the created executable file does not run without DLLs.
I've read online that this is can happen and all that is required is that the respective DLLs be copied to the location of the exe file. However... the error messages identify DLLs that my machine does not have.
I get and error message for the following DLL files.
Qt5Cored.dll, Qt5Widgetsd.dll, QtPrintSupportd.dll
I do not have the DLLs above. I do however have the dll files below. Which do not have the added 'd' before the extension.
Qt5Core.dll, Qt5Widgets.dll, QtPrintSupport.dll
Any help provided would be much appreciated.
Thank you in advance!
First i can't think of any reason you would want to copy (preparing for an installer) the dependencies for the debug build of your application, the debug is not a build that you want to deploy, use the release build for deployment.
Now, that being said, you definitely have the dll's, otherwise your debug build won't run from Qt Creator, you are just not looking in the right path for those dlls.
The path where you find the dll is something like: C:\Qt\5.12.3\msvc2017_64\bin
notice that there can be many Qt versions installed and for different targets (example android), so the right way to find the dlls is: QT_INSTALL_PATH / QT_VERSION / COMPILER_VERSION _ARCHITECTURE / bin, so the sample path i provided is Qt version 5.12.3 build with Visual Studio 2017's compiler and it is a 64 bit build. In that path you will find the right dlls: Qt5Core.dll (the release build), Qt5Cored.dll (debug) and so on for all the Qt modules.
Side note: you most likely looked into the folder where Qt Creator .exe is located, there you will find only the Qt dlls that are needed for Qt Creator to work, you are not supposed to use those dlls to deploy your application (those might be built with a different compiler than what you are using and even cause crashes for your application, because of incompatible abi)

QT 5 Creator INclude required DLL's in Executable

I have created a simple file copy program that I would like to run as a stand alone executable.
However when I run it outside Qtcreator I get a Qt5Core.dll is not found error.
I have found some stuff about copying the dll to the same folder as the executable or compiling staticly, but I have had no luck with this.
Is there a way to embed all the required dll's n the executable?
Preferably with the .pro file
Thanks,

How to compile a program in wxSmith ( Codeblocks ) with all the libraries?

I have created a program in Codeblocks (wxWidgets Application) I have compiled it and it runs perfectly when executed from the codeblocks interface ....however when i go into the release folder and run the executable it gives me *.dll file errors :/
How do i make the program ?
There's a good chance that Code:Blocks has a default setting for the executable path that includes the path to the libraries. As Windows finds the DLLs using the PATH environment variable this will ensure that your application works inside CodeBlocks.
However in order to run it outside CodeBlocks you'd need to either copy all the dependencies into the directory that holds your application or you'll have to set your PATH variable to include the directories that hold the dependencies.