Qt Creator 的项目搞砸了

Qt Creator's project messed up

我正在尝试将 crypto++ 库添加到 QtCreator IDE 中的 Qt 项目。我在项目中添加 crypto++ 源而不是添加 .so 库时犯了一个错误。因此,我从 qt 项目中删除了 crypto++ 目录以重新获得加密前项目状态,编译和链接没有问题。在 crypto++ 之前,我还添加了 QCustomPlot 并在没有任何 errors.Now 的情况下编译和构建了项目 由于以下错误,我无法再重新编译和重建项目:

09:19:42: Running steps for project ueTestProject...
09:19:42: Configuration unchanged, skipping qmake step.
09:19:42: Starting: "/usr/bin/make"
g++ -Wl,-rpath,/opt/Qt/5.4/gcc_64 -Wl,-rpath,/opt/Qt/5.4/gcc_64/lib -o ueTestProject main.o cmainwindow.o ueborderlayout.o uecentralwidget.o qcustomplot.o uegraphwidget.o uetopmerchandisewidget.o uetopmerchandiseview.o uepossesttings.o   -L/opt/Qt/5.4/gcc_64/lib -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Sql -lQt5Core -lGL -lpthread
cmainwindow.o: In function `CMainWindow::CMainWindow(QWidget*)':
/home/developeruser/projects/ueTestProject/bin/../cmainwindow.cpp:4: undefined reference to `vtable for CMainWindow'
/home/developeruser/projects/ueTestProject/bin/../cmainwindow.cpp:4: undefined reference to `vtable for CMainWindow'
cmainwindow.o: In function `CMainWindow::~CMainWindow()':
/home/developeruser/projects/ueTestProject/bin/../cmainwindow.cpp:23: undefined reference to `vtable for CMainWindow'
/home/developeruser/projects/ueTestProject/bin/../cmainwindow.cpp:23: undefined reference to `vtable for CMainWindow'
uecentralwidget.o: In function `UeCentralWidget::UeCentralWidget(QWidget*)':
/home/developeruser/projects/ueTestProject/bin/../gui/uecentralwidget.cpp:4: undefined reference to `vtable for UeCentralWidget'
/home/developeruser/projects/ueTestProject/bin/../gui/uecentralwidget.cpp:4: undefined reference to `vtable for UeCentralWidget'
uecentralwidget.o: In function `UeCentralWidget::~UeCentralWidget()':
/home/developeruser/projects/ueTestProject/bin/../gui/uecentralwidget.cpp:22: undefined reference to `vtable for UeCentralWidget'
/home/developeruser/projects/ueTestProject/bin/../gui/uecentralwidget.cpp:22: undefined reference to `vtable for UeCentralWidget'
qcustomplot.o: In function `QCPLayer::QCPLayer(QCustomPlot*, QString const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:755: undefined reference to `vtable for QCPLayer'
qcustomplot.o: In function `QCPLayer::~QCPLayer()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:761: undefined reference to `vtable for QCPLayer'
qcustomplot.o: In function `QCPLayerable::QCPLayerable(QCustomPlot*, QString, QCPLayerable*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:937: undefined reference to `vtable for QCPLayerable'
qcustomplot.o: In function `QCPLayerable::~QCPLayerable()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:948: undefined reference to `vtable for QCPLayerable'
qcustomplot.o: In function `QCPLayerable::moveToLayer(QCPLayer*, bool)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:1147: undefined reference to `QCPLayerable::layerChanged(QCPLayer*)'
qcustomplot.o: In function `QCPMarginGroup::QCPMarginGroup(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:1561: undefined reference to `vtable for QCPMarginGroup'
qcustomplot.o: In function `QCPMarginGroup::~QCPMarginGroup()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:1569: undefined reference to `vtable for QCPMarginGroup'
qcustomplot.o: In function `QCPLayoutElement::QCPLayoutElement(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:1753: undefined reference to `vtable for QCPLayoutElement'
qcustomplot.o: In function `QCPLayoutElement::~QCPLayoutElement()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:1757: undefined reference to `vtable for QCPLayoutElement'
qcustomplot.o: In function `QCPLayout::QCPLayout()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:2139: undefined reference to `vtable for QCPLayout'
qcustomplot.o: In function `QCPLayoutGrid::QCPLayoutGrid()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:2501: undefined reference to `vtable for QCPLayoutGrid'
qcustomplot.o: In function `QCPLayoutGrid::~QCPLayoutGrid()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:2505: undefined reference to `vtable for QCPLayoutGrid'
qcustomplot.o: In function `QCPLayoutInset::QCPLayoutInset()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:3095: undefined reference to `vtable for QCPLayoutInset'
qcustomplot.o: In function `QCPLayoutInset::~QCPLayoutInset()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:3099: undefined reference to `vtable for QCPLayoutInset'
qcustomplot.o: In function `QCPGrid::QCPGrid(QCPAxis*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:3691: undefined reference to `vtable for QCPGrid'
qcustomplot.o: In function `QCPAxis::QCPAxis(QCPAxisRect*, QCPAxis::AxisType)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4050: undefined reference to `vtable for QCPAxis'
qcustomplot.o: In function `QCPAxis::~QCPAxis()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4075: undefined reference to `vtable for QCPAxis'
qcustomplot.o: In function `QCPAxis::setScaleType(QCPAxis::ScaleType)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4181: undefined reference to `QCPAxis::scaleTypeChanged(QCPAxis::ScaleType)'
qcustomplot.o: In function `QCPAxis::setRange(QCPRange const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4226: undefined reference to `QCPAxis::rangeChanged(QCPRange const&)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4227: undefined reference to `QCPAxis::rangeChanged(QCPRange const&, QCPRange const&)'
qcustomplot.o: In function `QCPAxis::setSelectableParts(QFlags<QCPAxis::SelectablePart> const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4245: undefined reference to `QCPAxis::selectableChanged(QFlags<QCPAxis::SelectablePart> const&)'
qcustomplot.o: In function `QCPAxis::setSelectedParts(QFlags<QCPAxis::SelectablePart> const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4269: undefined reference to `QCPAxis::selectionChanged(QFlags<QCPAxis::SelectablePart> const&)'
qcustomplot.o: In function `QCPAxis::setRange(double, double)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4299: undefined reference to `QCPAxis::rangeChanged(QCPRange const&)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4300: undefined reference to `QCPAxis::rangeChanged(QCPRange const&, QCPRange const&)'
qcustomplot.o: In function `QCPAxis::setRangeLower(double)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4343: undefined reference to `QCPAxis::rangeChanged(QCPRange const&)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4344: undefined reference to `QCPAxis::rangeChanged(QCPRange const&, QCPRange const&)'
qcustomplot.o: In function `QCPAxis::setRangeUpper(double)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4366: undefined reference to `QCPAxis::rangeChanged(QCPRange const&)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:4367: undefined reference to `QCPAxis::rangeChanged(QCPRange const&, QCPRange const&)'
qcustomplot.o: In function `QCPAxis::moveRange(double)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:5168: undefined reference to `QCPAxis::rangeChanged(QCPRange const&)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:5169: undefined reference to `QCPAxis::rangeChanged(QCPRange const&, QCPRange const&)'
qcustomplot.o: In function `QCPAxis::scaleRange(double, double)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:5201: undefined reference to `QCPAxis::rangeChanged(QCPRange const&)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:5202: undefined reference to `QCPAxis::rangeChanged(QCPRange const&, QCPRange const&)'
qcustomplot.o: In function `QCPAxis::setupTickVectors()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:5530: undefined reference to `QCPAxis::ticksRequest()'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:5595: undefined reference to `QCPAxis::ticksRequest()'
qcustomplot.o: In function `QCPAbstractPlottable::QCPAbstractPlottable(QCPAxis*, QCPAxis*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:6853: undefined reference to `vtable for QCPAbstractPlottable'
qcustomplot.o: In function `QCPAbstractPlottable::setSelectable(bool)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:7000: undefined reference to `QCPAbstractPlottable::selectableChanged(bool)'
qcustomplot.o: In function `QCPAbstractPlottable::setSelected(bool)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:7023: undefined reference to `QCPAbstractPlottable::selectionChanged(bool)'
qcustomplot.o: In function `QCPAbstractItem::QCPAbstractItem(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:8359: undefined reference to `vtable for QCPAbstractItem'
qcustomplot.o: In function `QCPAbstractItem::~QCPAbstractItem()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:8369: undefined reference to `vtable for QCPAbstractItem'
qcustomplot.o: In function `QCPAbstractItem::setSelectable(bool)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:8421: undefined reference to `QCPAbstractItem::selectableChanged(bool)'
qcustomplot.o: In function `QCPAbstractItem::setSelected(bool)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:8444: undefined reference to `QCPAbstractItem::selectionChanged(bool)'
qcustomplot.o: In function `QCustomPlot::QCustomPlot(QWidget*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:9056: undefined reference to `vtable for QCustomPlot'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:9056: undefined reference to `vtable for QCustomPlot'
qcustomplot.o: In function `QCustomPlot::~QCustomPlot()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:9106: undefined reference to `vtable for QCustomPlot'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:9106: undefined reference to `vtable for QCustomPlot'
qcustomplot.o: In function `QCustomPlot::replot(QCustomPlot::RefreshPriority)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10384: undefined reference to `QCustomPlot::beforeReplot()'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10403: undefined reference to `QCustomPlot::afterReplot()'
qcustomplot.o: In function `QCustomPlot::mouseDoubleClickEvent(QMouseEvent*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10700: undefined reference to `QCustomPlot::mouseDoubleClick(QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10707: undefined reference to `QCustomPlot::plottableDoubleClick(QCPAbstractPlottable*, QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10709: undefined reference to `QCustomPlot::axisDoubleClick(QCPAxis*, QCPAxis::SelectablePart, QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10711: undefined reference to `QCustomPlot::itemDoubleClick(QCPAbstractItem*, QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10713: undefined reference to `QCustomPlot::legendDoubleClick(QCPLegend*, QCPAbstractLegendItem*, QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10715: undefined reference to `QCustomPlot::legendDoubleClick(QCPLegend*, QCPAbstractLegendItem*, QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10717: undefined reference to `QCustomPlot::titleDoubleClick(QMouseEvent*, QCPPlotTitle*)'
qcustomplot.o: In function `QCustomPlot::mousePressEvent(QMouseEvent*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10742: undefined reference to `QCustomPlot::mousePress(QMouseEvent*)'
qcustomplot.o: In function `QCustomPlot::mouseMoveEvent(QMouseEvent*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10764: undefined reference to `QCustomPlot::mouseMove(QMouseEvent*)'
qcustomplot.o: In function `QCustomPlot::mouseReleaseEvent(QMouseEvent*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10789: undefined reference to `QCustomPlot::mouseRelease(QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10826: undefined reference to `QCustomPlot::selectionChangedByUser()'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10833: undefined reference to `QCustomPlot::plottableClick(QCPAbstractPlottable*, QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10835: undefined reference to `QCustomPlot::axisClick(QCPAxis*, QCPAxis::SelectablePart, QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10837: undefined reference to `QCustomPlot::itemClick(QCPAbstractItem*, QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10839: undefined reference to `QCustomPlot::legendClick(QCPLegend*, QCPAbstractLegendItem*, QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10841: undefined reference to `QCustomPlot::legendClick(QCPLegend*, QCPAbstractLegendItem*, QMouseEvent*)'
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10843: undefined reference to `QCustomPlot::titleClick(QMouseEvent*, QCPPlotTitle*)'
qcustomplot.o: In function `QCustomPlot::wheelEvent(QWheelEvent*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:10867: undefined reference to `QCustomPlot::mouseWheel(QWheelEvent*)'
qcustomplot.o: In function `QCPAxisRect::QCPAxisRect(QCustomPlot*, bool)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:11749: undefined reference to `vtable for QCPAxisRect'
qcustomplot.o: In function `QCPAxisRect::~QCPAxisRect()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:11783: undefined reference to `vtable for QCPAxisRect'
qcustomplot.o: In function `QCPAbstractLegendItem::QCPAbstractLegendItem(QCPLegend*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:12668: undefined reference to `vtable for QCPAbstractLegendItem'
qcustomplot.o: In function `QCPAbstractLegendItem::setSelectable(bool)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:12726: undefined reference to `QCPAbstractLegendItem::selectableChanged(bool)'
qcustomplot.o: In function `QCPAbstractLegendItem::setSelected(bool)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:12743: undefined reference to `QCPAbstractLegendItem::selectionChanged(bool)'
qcustomplot.o: In function `QCPPlottableLegendItem::QCPPlottableLegendItem(QCPLegend*, QCPAbstractPlottable*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:12838: undefined reference to `vtable for QCPPlottableLegendItem'
qcustomplot.o: In function `QCPLegend::QCPLegend()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:12966: undefined reference to `vtable for QCPLegend'
qcustomplot.o: In function `QCPLegend::~QCPLegend()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:12989: undefined reference to `vtable for QCPLegend'
qcustomplot.o: In function `QCPLegend::setSelectableParts(QFlags<QCPLegend::SelectablePart> const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13122: undefined reference to `QCPLegend::selectableChanged(QFlags<QCPLegend::SelectablePart>)'
qcustomplot.o: In function `QCPLegend::setSelectedParts(QFlags<QCPLegend::SelectablePart> const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13168: undefined reference to `QCPLegend::selectionChanged(QFlags<QCPLegend::SelectablePart>)'
qcustomplot.o: In function `QCPPlotTitle::QCPPlotTitle(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13536: undefined reference to `vtable for QCPPlotTitle'
qcustomplot.o: In function `QCPPlotTitle::QCPPlotTitle(QCustomPlot*, QString const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13559: undefined reference to `vtable for QCPPlotTitle'
qcustomplot.o: In function `QCPPlotTitle::setSelectable(bool)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13626: undefined reference to `QCPPlotTitle::selectableChanged(bool)'
qcustomplot.o: In function `QCPPlotTitle::setSelected(bool)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13642: undefined reference to `QCPPlotTitle::selectionChanged(bool)'
qcustomplot.o: In function `QCPColorScale::QCPColorScale(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13841: undefined reference to `vtable for QCPColorScale'
qcustomplot.o: In function `QCPColorScale::~QCPColorScale()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13848: undefined reference to `vtable for QCPColorScale'
qcustomplot.o: In function `QCPColorScale::setDataRange(QCPRange const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13957: undefined reference to `QCPColorScale::dataRangeChanged(QCPRange)'
qcustomplot.o: In function `QCPColorScale::setDataScaleType(QCPAxis::ScaleType)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13980: undefined reference to `QCPColorScale::dataScaleTypeChanged(QCPAxis::ScaleType)'
qcustomplot.o: In function `QCPColorScale::setGradient(QCPColorGradient const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:13998: undefined reference to `QCPColorScale::gradientChanged(QCPColorGradient)'
qcustomplot.o: In function `QCPColorScaleAxisRectPrivate::QCPColorScaleAxisRectPrivate(QCPColorScale*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:14253: undefined reference to `vtable for QCPColorScaleAxisRectPrivate'
qcustomplot.o: In function `QCPGraph::QCPGraph(QCPAxis*, QCPAxis*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:14502: undefined reference to `vtable for QCPGraph'
qcustomplot.o: In function `QCPGraph::~QCPGraph()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:14520: undefined reference to `vtable for QCPGraph'
qcustomplot.o: In function `QCPCurve::QCPCurve(QCPAxis*, QCPAxis*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:16806: undefined reference to `vtable for QCPCurve'
qcustomplot.o: In function `QCPCurve::~QCPCurve()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:16822: undefined reference to `vtable for QCPCurve'
qcustomplot.o: In function `QCPBarsGroup::QCPBarsGroup(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:18068: undefined reference to `vtable for QCPBarsGroup'
qcustomplot.o: In function `QCPBarsGroup::~QCPBarsGroup()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:18072: undefined reference to `vtable for QCPBarsGroup'
qcustomplot.o: In function `QCPBars::QCPBars(QCPAxis*, QCPAxis*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:18444: undefined reference to `vtable for QCPBars'
qcustomplot.o: In function `QCPBars::~QCPBars()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:18457: undefined reference to `vtable for QCPBars'
qcustomplot.o: In function `QCPStatisticalBox::QCPStatisticalBox(QCPAxis*, QCPAxis*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:19187: undefined reference to `vtable for QCPStatisticalBox'
qcustomplot.o: In function `QCPColorMap::QCPColorMap(QCPAxis*, QCPAxis*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:20074: undefined reference to `vtable for QCPColorMap'
qcustomplot.o: In function `QCPColorMap::~QCPColorMap()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:20078: undefined reference to `vtable for QCPColorMap'
qcustomplot.o: In function `QCPColorMap::setDataRange(QCPRange const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:20126: undefined reference to `QCPColorMap::dataRangeChanged(QCPRange)'
qcustomplot.o: In function `QCPColorMap::setDataScaleType(QCPAxis::ScaleType)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:20141: undefined reference to `QCPColorMap::dataScaleTypeChanged(QCPAxis::ScaleType)'
qcustomplot.o: In function `QCPColorMap::setGradient(QCPColorGradient const&)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:20164: undefined reference to `QCPColorMap::gradientChanged(QCPColorGradient)'
qcustomplot.o: In function `QCPFinancial::QCPFinancial(QCPAxis*, QCPAxis*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:20574: undefined reference to `vtable for QCPFinancial'
qcustomplot.o: In function `QCPFinancial::~QCPFinancial()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:20582: undefined reference to `vtable for QCPFinancial'
qcustomplot.o: In function `QCPItemStraightLine::QCPItemStraightLine(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:21404: undefined reference to `vtable for QCPItemStraightLine'
qcustomplot.o: In function `QCPItemStraightLine::~QCPItemStraightLine()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:21413: undefined reference to `vtable for QCPItemStraightLine'
qcustomplot.o: In function `QCPItemLine::QCPItemLine(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:21594: undefined reference to `vtable for QCPItemLine'
qcustomplot.o: In function `QCPItemLine::~QCPItemLine()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:21603: undefined reference to `vtable for QCPItemLine'
qcustomplot.o: In function `QCPItemCurve::QCPItemCurve(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:21829: undefined reference to `vtable for QCPItemCurve'
qcustomplot.o: In function `QCPItemCurve::~QCPItemCurve()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:21840: undefined reference to `vtable for QCPItemCurve'
qcustomplot.o: In function `QCPItemRect::QCPItemRect(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:21983: undefined reference to `vtable for QCPItemRect'
qcustomplot.o: In function `QCPItemRect::~QCPItemRect()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:21994: undefined reference to `vtable for QCPItemRect'
qcustomplot.o: In function `QCPItemText::QCPItemText(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:22142: undefined reference to `vtable for QCPItemText'
qcustomplot.o: In function `QCPItemText::~QCPItemText()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:22159: undefined reference to `vtable for QCPItemText'
qcustomplot.o: In function `QCPItemEllipse::QCPItemEllipse(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:22482: undefined reference to `vtable for QCPItemEllipse'
qcustomplot.o: In function `QCPItemEllipse::~QCPItemEllipse()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:22493: undefined reference to `vtable for QCPItemEllipse'
qcustomplot.o: In function `QCPItemPixmap::QCPItemPixmap(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:22669: undefined reference to `vtable for QCPItemPixmap'
qcustomplot.o: In function `QCPItemPixmap::~QCPItemPixmap()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:22679: undefined reference to `vtable for QCPItemPixmap'
qcustomplot.o: In function `QCPItemTracer::QCPItemTracer(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:22922: undefined reference to `vtable for QCPItemTracer'
qcustomplot.o: In function `QCPItemTracer::~QCPItemTracer()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:22936: undefined reference to `vtable for QCPItemTracer'
qcustomplot.o: In function `QCPItemBracket::QCPItemBracket(QCustomPlot*)':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:23276: undefined reference to `vtable for QCPItemBracket'
qcustomplot.o: In function `QCPItemBracket::~QCPItemBracket()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.cpp:23287: undefined reference to `vtable for QCPItemBracket'
qcustomplot.o: In function `QCPLayout::~QCPLayout()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.h:719: undefined reference to `vtable for QCPLayout'
qcustomplot.o: In function `QCPAbstractPlottable::~QCPAbstractPlottable()':
/home/developeruser/projects/ueTestProject/bin/../plot/qcustomplot.h:1388: undefined reference to `vtable for QCPAbstractPlottable'
qcustomplot.o: In function `QCPLayout* qobject_cast<QCPLayout*>(QObject*)':
/opt/Qt/5.4/gcc_64/include/QtCore/qobject.h:520: undefined reference to `QCPLayout::staticMetaObject'
qcustomplot.o: In function `QCPGraph* qobject_cast<QCPGraph*>(QObject*)':

这些只是部分错误,由于堆栈溢出的 30000 个字符限制,我无法将它们全部粘贴。 这里还有 .pro 文件:

#-------------------------------------------------
#
# Project created by QtCreator 2015-02-16T15:51:38
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport sql

TARGET = ueTestProject
TEMPLATE = app

SOURCES += main.cpp\
    cmainwindow.cpp \
    layouts/ueborderlayout.cpp \
    gui/uecentralwidget.cpp \
    plot/qcustomplot.cpp \
    gui/uegraphwidget.cpp \
    gui/uetopmerchandisewidget.cpp \
    gui/uetopmerchandiseview.cpp \
    settings/uepossesttings.cpp \

什么分手了?

您可以关闭 QtCreator,删除 .pro.user 文件和 Makefile 以及除源文件和头文件之外的所有其他文件。然后通过 QtCreator

再次打开并配置项目

这些错误似乎是因为编译器找不到应该由 Qt 预编译器 (MOC) 生成的代码。可能您之前的 .pro 配置中仍有 "trash"。

建议您在更改 .pro 文件后清理并重新编译项目。您可以在 Using the Meta-Object Compiler (moc).

阅读更多相关信息

您可以在 QtCreator 中尝试这个:

Build > Clean All
Build > Run qmake
Build > Build All

我删除了整个项目(备份后),创建了同名的新项目,在同一层次结构中添加了 headers 和源,现在工作正常! headers 在项目中没有看到的原因是 .pro 文件中的 HEADERS 部分被莫名其妙地删除了。

我通过将包含文件本身添加到项目中解决了这个问题。

因此 headers 部分还应包含 qcustomplot.h

显然,对于标准 C/C++ 编译器(MSVC++ gcc 等),您无需明确让编译器识别 header,只要指定包含文件夹即可。 Qt 显然有一些额外的魔力。