I figure this is probably a dumb question with a simple answer, but this has been driving me up the wall.

I'm trying to load an SVG image into a QGraphicsScene via a QGraphicsSvgItem (that right so far?), and every time I try to create the QGraphicsSvgItem object, I get this error:


<removed>\Projects\Qt\workspace\SvgContainer\svgco ntainer.cpp:16: error: undefined reference to `_imp___ZN16QGraphicsSvgItemC1ERK7QStringP13QGraph icsItem'


I don't even understand what this is trying to tell me. Here's my code:

code.h
Qt Code:
  1. #ifndef SVGCONTAINER_H
  2. #define SVGCONTAINER_H
  3.  
  4. #include <QWidget>
  5.  
  6. namespace Ui {
  7. class SVGContainer;
  8. }
  9.  
  10. class SVGContainer : public QWidget
  11. {
  12. Q_OBJECT
  13.  
  14. public:
  15. explicit SVGContainer(QWidget *parent = 0);
  16. ~SVGContainer();
  17.  
  18. private:
  19. Ui::SVGContainer *ui;
  20. };
  21.  
  22. #endif // SVGCONTAINER_H
To copy to clipboard, switch view to plain text mode 

code.cpp
Qt Code:
  1. #include "svgcontainer.h"
  2. #include "ui_svgcontainer.h"
  3. #include <QtSvg/QGraphicsSvgItem>
  4.  
  5. SVGContainer::SVGContainer(QWidget *parent) :
  6. QWidget(parent),
  7. ui(new Ui::SVGContainer)
  8. {
  9. ui->setupUi(this);
  10.  
  11. QGraphicsScene *scene = new QGraphicsScene(this);
  12. ui->graphicsView->setScene(scene);
  13. QGraphicsSvgItem *svgItem = new QGraphicsSvgItem("assets\\outline.svg"); // <- Errors happen here
  14. scene->addItem(svgItem);
  15. }
  16.  
  17. SVGContainer::~SVGContainer()
  18. {
  19. delete ui;
  20. }
To copy to clipboard, switch view to plain text mode