Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QtWidgets: No such file or directory
I was using Qt 4.8, but failed to compile the affine example. Then I found the only solution seems to be using Qt 5.
I downloaded Qt 5.1.0 for Windows 64-bit (VS 2012, 525 MB). I don't have VS2012, instead I have VS2010. But I have to download this, because my computer is 64 bit windows. So I configured the compiler under the "Tools". The VS2010 is automatically detected, and I rename it as MSVS10.
Now I cannot see the "MSVS10" under "kit" behind the green arrow button.
And when I run it with kit "Desktop", it says the QtWidgets: No such file or directory.
Anyone could help?
Hi and welcome to devnet,
Then use the VS2010 build (don't mix newer and older mscv version that's asking for trouble). There is absolutely no problem using a 32bit program in Windows 64bit (or building it)
For Qt 5 widgets have been moved to their own module. Add
@QT += widgets@
To your pro file
Hope it helps
Hi SGaist, I have checked the pro file, that statement is there.
First thing, clean your Qt install and get the VS2010 build, then delete your project build directory and rebuild your project
Hi SGaist, thank you for the prompt help. I guess you mean to clean the project, and then build it? So I right click on the project, pressing "clean" and then pressing "build", still the same "QtWidgets: no such file or directory". And I also noticed that although I choose the VS2010 in "Tools options", but the compiler that I named does not show behind the "kit", i.e., the green arrow button. And I also changed Qt4.8 ev. QTDIR value to the new Qt5.1.0 directory.
Like I said, you are mixing 2012 and 2010 => just asking for trouble. The compilers are not same. Remove your 2012 Qt and get the 2010, then make a kit with it.
Don't play to much around, you are just going to end with a system unusable for development.
Hi SGaist, thank you the problem is solved.
But I have some unclear questions:
there is an official guide to show how to choose the compiler in the IDE, why it failed with affine example by saying QtWidgets is missing, I guess probably I didn't choose the compiler in a correct way?
The first thing is to get the Qt version that matches your compiler. If you don't have any, start with mingw otherwise, install Visual Studio then Qt. That will automate most thing for you (like the compiler selection)
Hi SGaist, based on the results that is the solution, at least to compile the examples. Thanks.
Why the 64 bits and 32 bits Qt5.1.0 both work on my 64 bit Windows? if both work undistinguishedlly, why there are both available to download?
Because Windows 64 bit allows to also run 32bit application. They work but not undistinguished.
Because not all Windows system around the world are 64bit, some legacy library are not 64bit, some legacy system can't be updated to 64bit
Hi SGaist, then what are the purpose for the 64 bit Qt 5.1.0 ? under which occasion should I use the 64 bit one and under which occasion should I use the 32 bit one?
so many questions about it 'cause I m really interested in Qt :))
To relieve you from the duty of building Qt yourself, which can be complex for the 5 series.
64bit as much as possible, 32bit when building for system running a 32bit version of windows. Beware that there are some differences between 32bit and 64bit development, one being the RAM size accessible from the application.
Hi SGaist, all clear so far, thank you! :))
You're welcome ! Happy coding :)