久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Qt 鏈接器錯(cuò)誤:“對(duì) vtable 的未定義引用"

Qt Linker Error: quot;undefined reference to vtablequot;(Qt 鏈接器錯(cuò)誤:“對(duì) vtable 的未定義引用)
本文介紹了Qt 鏈接器錯(cuò)誤:“對(duì) vtable 的未定義引用"的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

這是我的標(biāo)題:

#ifndef BARELYSOCKET_H
#define BARELYSOCKET_H

#include <QObject>
//! The First Draw of the BarelySocket!

class BarelySocket: public QObject
{
    Q_OBJECT

public:
    BarelySocket();
public slots:
    void sendMessage(Message aMessage);
signals:
    void reciveMessage(Message aMessage);

private:
    //   QVector<Message> reciveMessages;
};

#endif // BARELYSOCKET_H

這是我的課:

#include <QTGui>
#include <QObject>
#include "type.h"
#include "client.h"
#include "server.h"

#include "barelysocket.h"

BarelySocket::BarelySocket()
{
    //this->reciveMessages.clear();
    qDebug("BarelySocket::BarelySocket()");
}

void BarelySocket::sendMessage(Message aMessage)
{
}

void BarelySocket::reciveMessage(Message aMessage)
{
}

我收到鏈接器錯(cuò)誤:

undefined reference to 'vtable for BarelySocket'

  • 這意味著我有一個(gè)沒(méi)有實(shí)現(xiàn)的虛方法.但是有我的類(lèi)中沒(méi)有虛擬方法.
  • 我注釋掉了向量,認(rèn)為這是原因,但是錯(cuò)誤并沒(méi)有消失.
  • Message 是一個(gè)復(fù)雜的 struct,但即使使用 int不解決問(wèn)題.
    • This implies that I have a virtual method not implemented. But there are no virtual methods in my class.
    • I commented out the vector thinking that it was the cause, but the error did not go away.
    • The Message is a complex struct, but even using int instead did not fix things.
    • 推薦答案

      任何時(shí)候添加對(duì) Q_OBJECT 宏的新調(diào)用,都需要再次運(yùn)行 qmake.您所指的 vtables 問(wèn)題與此直接相關(guān).

      Any time you add a new call to the Q_OBJECT macro, you need to run qmake again. The vtables issue you're referring to is directly related to that.

      只要運(yùn)行 qmake,假設(shè)您的代碼中沒(méi)有其他問(wèn)題,您應(yīng)該會(huì)很高興.

      Just run qmake and you should be good to go assuming there are no other issues in your code.

      這篇關(guān)于Qt 鏈接器錯(cuò)誤:“對(duì) vtable 的未定義引用"的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

      【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數(shù)據(jù)?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫(xiě) for() 循環(huán): for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環(huán)?)
Reusing thread in loop c++(在循環(huán) C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環(huán)形?)
主站蜘蛛池模板: 亚洲成人一二三 | 久久国| 九九精品久久久 | 九九热九九 | 毛片一区二区三区 | 最新日韩在线 | 久草新在线 | 日韩乱码av| 九九热在线视频免费观看 | 国产一区免费视频 | 国产成人精品999在线观看 | 成人免费视频网站在线看 | 精品国产第一区二区三区 | 色综合久久伊人 | 日日干夜夜草 | 亚洲视频在线播放 | 99热精品在线观看 | 日日夜夜精品视频 | 亚洲 欧美 日韩在线 | 午夜激情免费 | 青青草av网站 | 欧美区日韩区 | 青娱乐av | 久久99蜜桃综合影院免费观看 | 欧美日韩一区二区在线播放 | 欧美第一区| 91久久精品一区二区三区 | 污污免费网站 | 午夜在线免费观看视频 | 成人在线免费观看av | 97色在线观看免费视频 | 国产精品呻吟久久av凹凸 | 91中文字幕在线观看 | 神马久久久久久久久久 | 国产高清视频在线播放 | 日本一二区视频 | 国产乱码精品1区2区3区 | 久久一视频 | 九九亚洲精品 | 九九色九九 | 亚洲视频在线一区 |