Issues deploying windows application
Hello everybody,
I am trying to build my application dynamically (because I downloaded Qt through the installer wizard and didn't build it statically) so I am using the minGW terminal and using the command cd C:/exe_path followed by the command windeployqt.exe --quick --no-translations . but the problem is that when I run the application there are two issues: the first one is that qwt.dll and qt5openGL.dll are missing and the second is that when I add those two dll's to the folder where the .exe and all the other dll are I still get a message saying that the app is unable to find the entry point for the dll's.
I would be so grateful if someone would help me out with this, I am only looking for the steps to follow because I have to send my project as soon as possible so I have little time to be understanding what is going on with the compiler and all of this...
Thank you!
Jorge
Re: Issues deploying windows application
Quote:
when I add those two dll's to the folder where the .exe and all the other dll are
Were both of these DLLs compiled with the minGW compiler you used for your application? Are both of these DLLs the correct "bitness" (32 or 64). the same as your app?
Re: Issues deploying windows application
I'm not sure if I understand what building with mingw means, because I only used mingw to do the windeployqt and once it finished I started adding .dll files manually to the folder where the .exe is, which is what I saw on some youtube videos.
Also, for the 64 or 32 bits I cannot tell 100%. The qwt.dll is only one file so I don't have other options, while qt5opengl.dll was the one I found inside C:\Qt\5.9.3\mingw53_32\bin folder...
Thank you!
Re: Issues deploying windows application
You are going to have to learn what a toolchain is and what the steps involved in compiling, linking, and deployment are. You can't simply grab files from here or there whose names happen to match the ones your app is looking for and expect them to work. The basic rules for Windows are:
0 - Obviously, all binary files have to be compiled with a toolchain that targets the Windows runtime.
1 - All binary files must be compiled using the same compiler, including any third-party DLLs you use. In this case, if you are using gcc (from minGW) as your toolchain compiler, everything must be compiled using that compiler.
2 - All binary files must be compiled using the same "bitness" (32 or 64 bit)
3 - All binary files must have the same "mode" (Debug or Release)
The reasons for this are that in C++, each compiler is free to "mangle" the names and signatures of exported classes, methods, and variables as it sees fit. When you link an EXE that expects to find a method int MyMethod( int x, int y, int z ) that is a member of MyClass, and that class is exported by MyLibrary.dll, then if MyLibrary.dll was compiled using gcc, the exported name might be "MyClass__MyMethod__%%i32%%i32%%i32%%i32". But if your EXE is compiled using the Microsoft Visual Studio compiler, it might mangle the same name as "MyClass&&MyMethod&&i&i&i&i". When the linker and runtime try to match things up, it can't find a match.
You are also going to have to learn how windeployqt works. It is supposed to drag all the dependent DLLs in for you. You don't need to manually copy files yourself. If you find that you need to do that, then you are using the tool incorrectly.
YouTube is usually a pretty unreliable source of information on how to build applications. You would be better off reading the Qt documentation.