Error LNK2019 with QGraphicsSvgItem



  • Hi,

    I want to use QGraphicsSvgItem but it doesn´t work. I´m sure that error is in it (without this one line of code everything works fine).

    @//#include <Qt/QGraphicsSvgItem.h>
    #include <QtSvg/QGraphicsSvgItem>

    QGraphicsSvgItem svgItem = new QGraphicsSvgItem(/":/mainwindow/image/Chess_rlt45.svg"*/);@

    Error:

    1> LINK : D:\Dokumenty\programovani\QT\test2\test2.exe not found or not built by the last incremental link; performing full link
    1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QGraphicsSvgItem::QGraphicsSvgItem(class QGraphicsItem *)" (_imp??0QGraphicsSvgItem@@QAE@PAVQGraphicsItem@@@Z) referenced in function _main
    1>main.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall QGraphicsSvgItem::metaObject(void)const " (?metaObject@QGraphicsSvgItem@@UBEPBUQMetaObject@@XZ)
    1>main.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall QGraphicsSvgItem::qt_metacast(char const *)" (?qt_metacast@QGraphicsSvgItem@@UAEPAXPBD@Z)
    1>main.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall QGraphicsSvgItem::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@QGraphicsSvgItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
    1>main.obj : error LNK2001: unresolved external symbol "public: virtual class QRectF __thiscall QGraphicsSvgItem::boundingRect(void)const " (?boundingRect@QGraphicsSvgItem@@UBE?AVQRectF@@XZ)
    1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall QGraphicsSvgItem::paint(class QPainter *,class QStyleOptionGraphicsItem const *,class QWidget *)" (?paint@QGraphicsSvgItem@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z)
    1>main.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall QGraphicsSvgItem::type(void)const " (?type@QGraphicsSvgItem@@UBEHXZ)
    1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QGraphicsSvgItem::~QGraphicsSvgItem(void)" (_imp??1QGraphicsSvgItem@@UAE@XZ) referenced in function "public: virtual void * __thiscall QGraphicsSvgItem::`scalar deleting destructor'(unsigned int)" (??_GQGraphicsSvgItem@@UAEPAXI@Z)
    1>D:\Dokumenty\programovani\QT\test2\test2.exe : fatal error LNK1120: 8 unresolved externals

    Everything else works fine. I don´t know what it´s wrong. I use MS Visual Studio 2010 with QT 4.8.0 on W7.


  • Moderators

    Are you using the vsaddin?
    Check the "Qt Project Settings". There are all the modules listed for inclusion. Probably svg library is missing.



  • koahnig: You´re absolutely right! So easy and it took me a lot of time. Thank you very much!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.