"Project ERROR: Unknown module(s) in QT: serialport" when using Qt VS Tools on Visual Studio 2022
-
I've been through a lot of other questions Unknown module(s) in QT: XXX, but I cannot find the solution for my problem.
I'm using version 6.6.1_msvc2019_64 on Windows with Qt VS Tools.
QtSerialPort library is installed (check Qt Maintenance Tool).
Using QtCreator, Qt examples like terminal work nice and smooth and so does a custom test project of mine created with a blank QMainWindow and just a adding QT += serialport to the .pro file.However, when adding QtSerialPort module in Visual Studio 2022 project
I get the qmake error mentioned in the title and reported below:
Build started... 1>------ Build started: Project: MyProject , Configuration: Release x64 ------ 1>Reading Qt configuration (C:/Qt/6.5.0/msvc2019_64/bin/qmake) 1>MyProject.vcxproj : error : ERROR running qmake 1>MyProject.vcxproj : error : qmake: (C:/Qt/6.5.0/msvc2019_64/bin/qmake) 1>MyProject.vcxproj : error : qmake: $PWD=C:\workspace\MySolution\MyProject\x64\Release\qmake\temp 1>MyProject.vcxproj : error : qmake: Project ERROR: Unknown module(s) in QT: serialport 1>MyProject.vcxproj : error : qmake: Error creating .vcxproj file 1>MyProject.vcxproj : error : 1>Done building project "MyProject.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ========== Elapsed 00:01.349 ==========
Note: cross-post on SO
-
Hi and welcome to devnet,
There's a discrepancy between the installation you show and the qmake output. You are showing that you have the module installed of Qt 6.6.1 but your error is showing 6.5.0. Did you forgot to install the module for that version of Qt ?
-
@SGaist You're very right indeed. Thank you!
I'm just realising now that if I select the Qt version from "Extensions --> Qt VS Tools --> Qt Versions", the same version is not updated in Project "Settings --> Qt Project Settings --> Qt Installation".Just out of curiosity, is it a bug or a feature?
-
-
@qtbuzz said in "Project ERROR: Unknown module(s) in QT: serialport" when using Qt VS Tools on Visual Studio 2022:
feature
I would say because you can have more than one Qt version installed.