How can i static build qt project in Visual Studio
-
Hi and welcome to devnet,
If you want a static Qt, then you will have to build Qt yourself that way. Don't forget the requirements that comes with the license you are using and that you have to abide to.
-
Thanks, first of all I just started using Qt and thanks for trying to help me!
Actually I want to share with others without needing other qt dll files and in low size (.mb).
But I guess there is no other way to do this other than static compiling, if there is, can you tell me? -
Another way is to build your own version of Qt with all unused features disabled. That requires some work as well.
Depending on the modules you use, you can shave off some things like unused image/database plugins.
-
he is can run his project with out qt desing
https://youtu.be/rFHPOZoqzcg?t=91
but i can't
i have a few dll error like the qt6core.dll q6widgets.dll qt6network.dll
i cant run my project with out qt desing -
@vandal_op said in How can i static build qt project in Visual Studio:
i have a few dll error like the qt6core.dll q6widgets.dll qt6network.dll
You need to adjust your PATH environment variable so the dlls are found during runtime.
-
@vandal_op said in How can i static build qt project in Visual Studio:
how can i do?
where is the dlls?
In your first post you wrote where you installed your Qt to, so I would start searching in there...
-
As you can see in your output you're building for MinGW, not MSVC. Adjust your environment (hint: Visual Studio Command prompt) so cl.exe is properly found by configure.bat/cmake.
-
i watch this video https://youtu.be/KCH92zvrHas?t=330t
and his have a gnuwin32 file in qt src but i dont have
and he is using this file for build.. -
@Christian-Ehrlicher did u have anything info?
-
@vandal_op said in How can i static build qt project in Visual Studio:
did u have anything info?
No - I already told you that you have to make sure that configure picks up the msvc compiler and not the MinGW one as you can't mix the two compiler. So clean up your build dir and start over.
-
@Christian-Ehrlicher finaly i can build now but not working again..
https://prnt.sc/dw5Ji91U6kK6
prefix folder is empty -
doesnt have jom make file
-
Have 3 folders (you can name them however you want):
/src //this is where Qt sources are /build // this is where you build /install //this is where you install
From start menu open x64 Native Tools Command prompt for VS. You don't need admin privileges.
cd
to your build directory (not src!)
In your build directory:
../src/configure -prefix <full path to install dir> -static -static-runtime <any other options you want>
cmake --build . --parallel
cmake --install .
if you also built debug version then alsocmake --install . --config Debug
That's it, 3 or 4 commands. -
@Chris-Kawa
it was running fine but still gave an error -
Read the third line.