I am trying to compile a project in Visual studio using Qt plug-in and QCustomPlot library. The code works perfectly fine in QT creator but when I migrate the code to Visual Studio (which I need to use for unrelated reasons) I get this linking error:
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: class QSharedPointer > __cdecl QCPStatisticalBox::data(void)const " (__imp_?data@QCPStatisticalBox@@QEBA?AV?$QSharedPointer@V?$QCPDataContainer@VQCPStatisticalBoxData@@@@@@XZ) referenced in function "public: void __cdecl mop_OUT::addord(double,char)" (?addord@mop_OUT@@QEAAXND@Z)
Please note: This is NOT an issue of failing to link against a lib file or dll that contains the definition. The QCustomPlot library package comes with no such files, only a header file (qcustomplot.h) and a source file (qcustomplot.cpp).
Furthermore, the missing symbol seems to already have an in-line definition in line 5673 of qcustomplot.h:
QSharedPointer<QCPStatisticalBoxDataContainer> data() const { return mDataContainer; }
Does anyone have any ideas as to what my be going on?