many thanks to all of you.
At the end I discovered that I added by mistake the main as resource file... :(
Sorry for bothering you.
No, I mean I can see the entire source code of the main.
I used this:
on my exe and I can see the entire source code of the main:
Yes, I also see some method names, but this is not a big problem.
It seems not to be possible to use -shared and -static-runtime together.
It is actually quite simple. You probably have the windeployqt tool witihin the bin directory of your current Qt installation. This tool does exactly what you want. Simply do this:
c:\path\to\qt\bin\windeployqt.exe --compiler-runtime c:\path\to\my\application.exe
It will gather all required dlls by your application including the runtime ones.
I already tried this, but it simply copy the vc_redist.x64.exe setup into destination folder, but then you need to be admin to install it, and in my case the app must be installed also if you are not admin
Usually the Visual Studio redist will install a couple of DLL's. Using dependency walker it is quite easy to figure out which DLLs are required by your application.
Dependency Walker get stuck analizing my simple application. And with this solution maybe I have to analyze also all qt dlls to be sure about their deps.
It may even be easier for you, depending on your Visual Studio version you can have a look in the following folder (14.0 = Visual Studio 2015, change accordingly to your version):
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist
You'll find a couple of folders which are of interest. If you're building a 32 bit application you'll need to go to the following folder:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT
Within that folder you find the DLLs as distributed by the redist package. Just copy these and put them near your executable. Furthermore you may need an additional DLL (ucrtbased.dll). This can be found in the Windows SDK directory using the same directory structure as for Visual Studio.
This last solution could be interesting. I gonna try to copy the dlls contained in the following folder:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.16.27012\x64\Microsoft.VC141.CRT
into my app folder and see if my app complains for missing dlls.
Thank you for now for your help, I hope it works
thank you for your answer.
I have to understand exactly which dlls are installed by the redist.
Do you have a suggestion on how to check exactly all the dlls installed by redist and where?
Also I am not sure if the redist installer does some other useful things like writing the registry, ...
For what I understand, I think that recompiling qt dlls with runtime-static doesn't require a commercial license because my application will continue to use qt dlls as before (lgpl).
Maybe I am wrong on this, so it could be good if someone could explain exactly on this aspect of qt.
My intention is not to compile qt with the -static flag, but only with -static-runtime only.
But the script for compiling qt doesn't allow -shared -static-runtime flags at the same time.
And this shouldn't have a technical reason because producing dlls that don't need the redist should be possible without problems.
I need to create a win app for the Desktop that can be installed also by not admin users.
But the vc_redist can be installed only by admins.
So I need to compile qt and my app with these flags:
If I try to compile qt sources with this configuration I get an error because it says that -static-runtime flag can be used only in combination with -static.
I think that it should technically possible to compile qt sources producing dlls (shared) but using the static runtime (-static-runtime or /MT), isn't it?
Can you help me on this, please?
Thank you in advance
Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.