QCustomPlot Discussion and Comments

QCP2 windows dll troublesReturn to overview

Hello there,

I'm having some trouble to use the shared library of QCustomplot 2.

Compilation is fine, However when I try to compile a program that make use of the shared library (set DEFINES += QCUSTOMPLOT_USE_LIBRARY) like in the provided example. The (MSVC) compiler complains about declspec import in template classes (QCPDataContainer and QCPAbstractPlottable1D):

f:\download\qcustomplot-sharedlib\qcustomplot.h:2574: erreur : C2491: 'QCPDataContainer<DataType>::QCPDataContainer': definition of dllimport function not allowed

I removed the QCP_LIB_DECL macro for those two template classes and everything is fine now (at least the sharedlib-usage example works). However, I'm lacking some knowledge and I'm wondering If I'm doing something correct.

J.

Same problem here. Any update?

gaminn, does removing the QCP_LIB_DECL statement in the class definition of QCPDataContainer (line 2374 of qcustomplot.h) solve the problem also in your case?

Since QCPDataContainer is a template, its implementation is put in the header by the amalgamation processor -- in consequence it shouldn't have a QCP_LIB_DECL statement, which I overlooked when creating the class. (This is also how it's fixed in the final 2.0.0)