QT compilation error: Project ERROR: Unknown module(s) in QT:xxxxx

1. Problem

During the Qt development process of embedded Linux for beginners, QT Creator can successfully compile with the original gcc_64 package, but cannot compile with the newly added 32-bit mips package. It will report: unknown module in qt: quick qml positioning quickcontrols2 multimedia mistake

2. Reasons

Literally understood, it should be that some modules of qt are missing or qt cannot call these modules, so the first purpose is to find these modules to see if they are missing or cannot be found.

3. Other options for reference

There are actually many solutions on the Internet, but the causes of most bugs may be different. Here are just a few that have been referenced, but they are not suitable for you.

1.MaintenanceTool

Open the installation directory, I installed it under /opt, so cd /opt/Qt5.12.9/, you can see there is a MaintenanceTool executable file, run it
Insert image description here
and then it will appear A page to add or update modules
Insert image description here

But I have all the modules in it, so it has no effect for me (I found out later: these are used by the native compilation package, and the ones used by the new package are not here)
So this solution is not suitable for me.

2. Answers from other respondents

NO.1

Insert image description here

sudo apt-get install libqt5quick5 libqt5qml5 libqt5positioning5 libqt5quickcontrols2-5 libqt5multimedia5 libqt5widgets5

Insert image description here
Insert image description here

NO.2

Insert image description here

NO.3

Insert image description here

NO.4

Insert image description here

sudo apt-get install libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediawidgets5 libqt5qml5 qtdeclarative5-qtquick2-plugin qtdeclarative5-quickcontrols2-plugin qtdeclarative5-quicklayouts-plugin qtdeclarative5-qtmultimedia-plugin qtdeclarative5-qtquick-layouts-plugin

Insert image description here

NO.5

Insert image description here

NO.6

Insert image description here

NO.7

Insert image description here

sudo apt-get install qtquick5-dev qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtgraphicaleffects qml-module-qtqml-models2 qml-module-qtqml-statemachine qml-module-qtqml-xmllistmodel qml-module-qtquick-layouts qml-module-qtquick-privatewidgets qml-module-qtquick-window2 qml-module-qtquick2 qml-module-qtquick2-privatewidgets qml-module-qtquick2-window2 qml-module-qtquick2-privatewidgets qml-module-qtquick-extras qml-module-qtquick-controls

Insert image description here

NO.8

Insert image description here

sudo apt-get install libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediawidgets5 libqt5qml-graphicaleffects libqt5quick5 libqt5quickcontrols2-5 libqt5quickparticles5 libqt5quickwidgets5 libqt5positioning5 libqt5sensors5* libqt5svg5* libqt5webkit5*

Insert image description here

NO.9

Insert image description here

3. Final solution

These missing modules are actually the missing libraries of the 32-bit package used. When compiling with the original package, it can pass normally because these libraries have been installed in the directory when installing Qt Creator.

So what you should do is to install the libraries corresponding to the compiler, but different people may use different compilation tools and corresponding libraries. But don’t worry, Qt has already provided the source code of each module. As long as you use your own compilation tool to compile the source code, you can generate a .so module library in the format corresponding to this compilation tool. For example, version 5.12.7 is used here. Go to https://download.qt.io/archive/qt/5.12/5.12.7/single/, download and decompress the qt-everywhere-src-5.12.7.tar.xz source code package (or what module is missing Just download the source code of the module), and then use your own tool chain to compile the source code of the corresponding module.

I won’t go into details here about how to compile the source code. My SDK can be run through make menuconfig under buildroot.

Insert image description here
Select target packages

Insert image description here
Enter Graphic libraries and applications (graphic/text) —>
Insert image description here
Select Qt5
Insert image description here
and then select the required module, save and apply the configuration, and then Make the main configuration to make the configuration take effect, and then make to compile the corresponding library.
Insert image description here
Insert image description here
Insert image description here

4. Conclusion

Find and solve your own problem after multiple consultations and thinking, and record it as one of the cases for reference.

Guess you like

Origin blog.csdn.net/qq_45875853/article/details/132916513