Error: undefined reference to `_imp___ZN8QPrinterC1ENS_11PrinterModeE'



  • When using this code :

    // Create a printer
    QPrinter printer;
    
    // Create a Dialog
    QPrintDialog dialog(&printer, this);
    dialog.setWindowTitle(tr("Print Document"));
    

    if (dialog.exec() == QDialog::Accepted) {

     }
    

    I've got errors when compiling

    Error: undefined reference to `_imp___ZN8QPrinterC1ENS_11PrinterModeE'

    Error: undefined reference to `_imp___ZN12QPrintDialogC1EP8QPrinterP7QWidget'

    What must I do?


  • Qt Champions 2017

    Hi
    Do you have
    QT += printsupport

    in the .pro file ?

    Ps. If you add it. remember to run qmake.


Log in to reply
 

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