Using QtCharts with VS2015+Qt VS Tool
-
I'm using Qt VS Tools with Qt 5.10.1_32bit. And my project is created with Qt VS Tool, so I have no ways to add "QT += charts" to the .pro file. But I manually add the header includes folder and the library is add to the dependency. Now my application is compiled ok. But when the code runs to "QChart *chart = new QChart;", there is an exception throw in Qt5Gui.dll :
0xC0000005: Access violation reading location 0x00000000.
I can't figure out where is wrong. Must I create .pro using QCreator, and add "QT += charts" to it, then convert it to Qt VS Tool project?
Any help?
-
Hello ,
I have had a similar problem about a week ago , check out my thread and see if my fix resolves your problem.
https://forum.qt.io/topic/88173/strange-access-violation-exception-with-qt-charts -
Thanks for all your replies.
I finally found the reason. It's similar to @TheTugaOne 's situation. I was compiling the debug version, but linking the non debug version of the Qt5Charts lib. When I link the debug version of Qt5Charts lib, all works well.