• moc_XXXX.o:(.data.rel.ro._ZTI12CalculatorUI[_ZTI12CalculatorUI]+0x10): undefined reference to `typeinfo for QWidget' collect2: error: ld returned 1 exit status make: *** [Makefile:144: myCalculator]


    main.cpp:(.text.startup+0x22): undefined reference to `QApplication::QApplication(int&, char**, int)'

    moc_CalculatorUI.o:(.data.rel.ro._ZTV12CalculatorUI[_ZTV12CalculatorUI]+0x1a0): undefined reference to `QWidget::inputMethodQuery(Qt::InputMethodQuery) const'
    moc_CalculatorUI.o:(.data.rel.ro._ZTV12CalculatorUI[_ZTV12CalculatorUI]+0x1a8): undefined reference to `QWidget::focusNextPrevChild(bool)'
    moc_CalculatorUI.o:(.data.rel.ro._ZTV12CalculatorUI[_ZTV12CalculatorUI]+0x1d0): undefined reference to `non-virtual thunk to QWidget::devType() const'
    moc_CalculatorUI.o:(.data.rel.ro._ZTV12CalculatorUI[_ZTV12CalculatorUI]+0x1d8): undefined reference to `non-virtual thunk to QWidget::paintEngine() const'
    moc_CalculatorUI.o:(.data.rel.ro._ZTV12CalculatorUI[_ZTV12CalculatorUI]+0x1e0): undefined reference to `non-virtual thunk to QWidget::metric(QPaintDevice::PaintDeviceMetric) const'
    moc_CalculatorUI.o:(.data.rel.ro._ZTV12CalculatorUI[_ZTV12CalculatorUI]+0x1e8): undefined reference to `non-virtual thunk to QWidget::initPainter(QPainter*) const'
    moc_CalculatorUI.o:(.data.rel.ro._ZTV12CalculatorUI[_ZTV12CalculatorUI]+0x1f0): undefined reference to `non-virtual thunk to QWidget::redirected(QPoint*) const'
    moc_CalculatorUI.o:(.data.rel.ro._ZTV12CalculatorUI[_ZTV12CalculatorUI]+0x1f8): undefined reference to `non-virtual thunk to QWidget::sharedPainter() const'
    moc_CalculatorUI.o:(.data.rel.ro+0x0): undefined reference to `QWidget::staticMetaObject'
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:144: myCalculator] Error 1

    在写Qt时候出现这种错误:解决方法   在.pro中加入  

    QT += core gui
    QT += widgets

    QT +=XXX

  • 相关阅读:
    Centos-706-在Win10中共享目录然后在Linux中访问
    Centos-706-在Linux中共享目录然后在Win10中访问
    Centos-706-配置文件
    Centos-706-daemon.json启用hosts后无法启动
    Centos-706-Docker开启远程访问
    Centos-706-Docker镜像-生成以及推送
    Centos-706-固定IP设置
    jquery.chosen.js实现模糊搜索
    Mysql索引分析:适合建索引?不适合建索引?【转】
    查看 Apache并发请求数及其TCP连接状态【转】
  • 原文地址:https://www.cnblogs.com/wzqstudy/p/9982566.html
Copyright © 2020-2023  润新知