PDA

View Full Version : QTCharts not found after installing them



calin2110
12th May 2021, 11:18
So, I'm trying to use some QtCharts and what I did was update the repositories and add QtCharts, but it seemed like a 0 mb update (as it told me) and when I'm trying to include QPieChart or something from QChart I get an error as it's not there. How could I fix it? Thank you

d_stranz
12th May 2021, 16:16
Did you add the path to the QtCharts include files to your project configuration? You can't just write #include <QPieChart> and expect your compiler to know where to find that file if it lives in a different path from other include files.

calin2110
12th May 2021, 19:27
Did you add the path to the QtCharts include files to your project configuration? You can't just write #include <QPieChart> and expect your compiler to know where to find that file if it lives in a different path from other include files.

I did not, as a matter of fact. How do I do that?

d_stranz
13th May 2021, 16:47
I have no idea what environment you are using for your builds. If you are using Qt Creator, you modify the .pro file (https://doc.qt.io/qt-5/qtcharts-index.html); if you are using Visual Studio on Windows, you modify the C++ Additional include directories setting in the project's Property Pages. In either case, you need to add the path to the include files.

You will also have to add the library file(s) and path to the linker options in Visual Studio.

calin2110
14th May 2021, 07:17
I can't seem to find QT Charts - maybe it was not installed? I'm using QT 5.15.2 - and it's not here, because I tried building it, but Maintenance tool tells me it's installed

d_stranz
14th May 2021, 16:56
In my installation of Qt 5.14.2 using MSVC 2015, 64 bit, the include files are at 5.14.2/msvc2015_64/include/QtCharts, the libraries are at 5.14.2/msvc2015_64/lib, and the DLLs under 5.14.2/msvc2015_64/bin. My MinGW install has them in the same places relative to the top level of the mingw path.

If you are working on linux I can't tell you where they might be.