I'm new to Qt GUI/Widget Application and I am trying to make a simple bar chart. I tried to copy the exact same code that QT provides in their website, [link]: https://doc-snapshots.qt.io/qt5-5.11/qtcharts-barchart-example.html#creating-bar-charts. However, I keep getting a lot of error message that says "QtCharts" file not found and "QBarSet" "QLegend" not found, basically every library that was included was not found.
I saw some troubleshoot page in QT website, it says that I have to add some import statement in my .qml file. But I can't seem to find where is the .qml file located? [link]: https://doc.qt.io/qt-5/qtcharts-index.html
My code looks exactly like this:
//main.cpp
----------
[link]: https://doc-snapshots.qt.io/qt5-5.11/qtcharts-barchart-main-cpp.html
//.pro file
------------
QT += core gui charts
//I only add "charts" in the above line from the original .pro file
//everything else is the exact same .pro file as in the original.
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = testing_file
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += \
mainwindow.h
FORMS += \
mainwindow.ui
How do you fix/make the code works? I really have no idea how to fix the error messages. Thanks!