最近工作需要,产品界面中需要用到显示实时波形,于是使用了QCustomPlot类库。这里写一下遇到的问题和解决。
E:HH-PM001build-detecter-Desktop_Qt_5_8_0_MinGW_32bit-Debugdebugqcustomplot.o:-1: In function `ZN11QCustomPlot7savePdfERK7QStringiiN3QCP9ExportPenES2_S2_':
E:HH-PM001trunkQCustomPlotqcustomplot.cpp:14244: error: undefined reference to `_imp___ZN8QPrinterC1ENS_11PrinterModeE'
E:HH-PM001trunkQCustomPlotqcustomplot.cpp:14246: error: undefined reference to `_imp___ZN8QPrinter15setOutputFormatENS_12OutputFormatE'
E:HH-PM001trunkQCustomPlotqcustomplot.cpp:14247: error: undefined reference to `_imp___ZN8QPrinter12setColorModeENS_9ColorModeE'
E:HH-PM001trunkQCustomPlotqcustomplot.cpp:14248: error: undefined reference to `_imp___ZNK8QPrinter11printEngineEv'
E:HH-PM001trunkQCustomPlotqcustomplot.cpp:14249: error: undefined reference to `_imp___ZNK8QPrinter11printEngineEv'
E:HH-PM001trunkQCustomPlotqcustomplot.cpp:14244: error: undefined reference to `_imp___ZN8QPrinterD1Ev'
E:HH-PM001trunkQCustomPlotqcustomplot.cpp:14244: error: undefined reference to `_imp___ZN8QPrinterD1Ev'
collect2.exe:-1: error: error: ld returned 1 exit status
认真看了一下,原来我忘记在工程文件.pro文件中添加下面的语句了。
QT
+=
printsupport
添加后,一切正常,因为qcustomplot.cpp中使用到了打印功能,所以这个是需要添加的。
最后
以上就是潇洒萝莉最近收集整理的关于使用QCustomPlot遇到的问题及解决的全部内容,更多相关使用QCustomPlot遇到内容请搜索靠谱客的其他文章。
发表评论 取消回复