Knowledge is not alone, it must be systematic. More my personal summary and related experience can be found in this column: Visual Studio .
This bug was encountered when I was working on this project: [Visual Studio] Qt's real-time drawing curve function, using C++ language, cooperates with Qt to develop serial communication interface .
question
Using C++ language and coordinating with Qt to develop the serial port communication interface, when adding Widget as the display box of QCharts, the error code C2653 is reported.
Copy the error message so that others can retrieve my article when searching. The error message is as follows:
Severity Code Description Project File Line Suppressed Display Status
Error C2653 "QtCharts": is not a class or namespace name (compile source file GUI.cpp) GUI C:\Users\jicha\source\repos\GUI\x64\Debug\uic\ ui_GUI.h 35
The screenshot of the error is as follows:
solution
The tutorials given on the Internet are correct, but they don't quite fit the architecture of my project. So QtCharts::QChartView
, QChartView
just change to .
A picture is better than the preface, and the solution should follow the picture below.
Then the picture below is a screenshot of the successful operation. hope this helps.