Results 1 to 3 of 3

Thread: Unresolved external error in Qt5 when using QPrinter

  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Unresolved external error in Qt5 when using QPrinter

    Hi all...
    I've getting a unresolved external error when compiling a program with Qt5 which has QPrinter object. Simply i define a QPrinter object and get the error.
    Is this a bug?!

    The Code:

    #include <QApplication>
    #include "mainwindow.h"
    #include <QPrinter>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    QPrinter printer; <= This is where the error comes...

    return a.exec();
    }

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Unresolved external error in Qt5 when using QPrinter

    From the QtPrintSupport module docs
    To include the definitions of the module's classes, use the following directive:

    #include <QtPrintSupport>

    To link against the module, add this line to your qmake .pro file:

    QT += printsupport

  3. The following user says thank you to ChrisW67 for this useful post:

    alizadeh91 (19th July 2012)

  4. #3
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Unresolved external error in Qt5 when using QPrinter

    Thanks Solved

Similar Threads

  1. error LNK2001: unresolved external symbol _IID_ID3DXEffec tStateManager
    By Tusharsankhala in forum Installation and Deployment
    Replies: 0
    Last Post: 16th May 2012, 18:16
  2. Replies: 3
    Last Post: 29th April 2011, 09:13
  3. Replies: 1
    Last Post: 19th February 2011, 13:32
  4. Replies: 4
    Last Post: 5th January 2011, 15:51
  5. Replies: 16
    Last Post: 23rd May 2008, 10:12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.