Hello,

I'm using Qt Creator on Windows XP to write a custom widget, and am having a frustrating problem. I am using (at least trying to use) QSvgRenderer to draw an SVG from a file onto a QPixmap. I then intend to perform manipulations on the QPixmap, and draw it to a custom widget.

I've tried and tried, but no matter what I do, I get errors of varying kinds. I think I have it stripped down to the basics of what should work:
Qt Code:
  1. QPixmap myClass::createPixmap()
  2. {
  3. QSvgRenderer renderer;
  4. renderer.load(imagePath); // imagePath is a private data member
  5. QPixmap myPixmap(width(), height());
  6. QPainter myPainter(&myPixmap);
  7. renderer.render(&myPainter);
  8. return myPixmap;
  9. //In my drawing function, I use a QPainter attached to the widget to draw the QPixmap onto the widget.
  10. }
To copy to clipboard, switch view to plain text mode 
Compiling results in a list of errors like:
Qt Code:
  1. undefined reference to `_imp___ZN12QSvgRendererC1EP7QObject'
  2. undefined reference to `_imp___ZN12QSvgRenderer4loadERK7QString'
  3. undefined reference to `_imp___ZN12QSvgRenderer6renderEP8QPainter'
  4. undefined reference to `_imp___ZN12QSvgRendererD1Ev'
  5. undefined reference to `_imp___ZN12QSvgRendererD1Ev'
To copy to clipboard, switch view to plain text mode 
Am I using the QSvgRenderer incorrectly? I included it as:
Qt Code:
  1. #include <QtSvg/QSvgRenderer>
To copy to clipboard, switch view to plain text mode 
because it would complain it couldn't find the files for "<QSvg>" or "<QSvgRenderer>". In an additional quirk, the compile would throw a "file not found" error on the include line if I typed the include by hand, but if I used the "intelisense"-like drop-down menu, it wouldn't complain about the include. But that may be another issue entirely.

I'm sure there's a simple solution which is blocked by my inexperience with Qt. Any ideas?