c++ - 未定义对类的 vtable 的引用
问题描述
我的课程DvQkdLdpcTxMessageProcessorReceiver
如下:
#ifndef DV_QKD_LDPC_TX_MESSAGE_PROCESSOR_RECEIVER_H_
#define DV_QKD_LDPC_TX_MESSAGE_PROCESSOR_RECEIVER_H_
#include "netxpto_20200819.h"
#include "dv_qkd_message_processor_common_20200819.h"
class DvQkdLdpcTxMessageProcessorReceiver : public Block
{
public:
DvQkdLdpcTxMessageProcessorReceiver(std::initializer_list<Signal*> InputSig, std::initializer_list<Signal*> OutputSig) : Block(InputSig, OutputSig) {};
void initialize(void);
bool runBlock(void);
private:
// Input Parameters ##################################################################################
// State Variables ###################################################################################
std::vector<t_message> storedMessages{};
// Basis Reconciliation
t_integer messageReconciliationMaximumDataLength{ 4096 };
CircularBuffer<t_binary> BasesFrom{ messageReconciliationMaximumDataLength };
// Parameter Estimation
t_integer messageParameterEstimationMaximumDataLength{ 100 };
t_integer numberOfProcessedBits{ -1 };
CircularBuffer<t_integer> SeedFrom{ 10 };
CircularBuffer<t_integer> RatioFrom{ 10 };
CircularBuffer<t_integer> NumberOfBitsPerEstimationBlockFrom{ 10 };
CircularBuffer<t_binary> DataFrom{ 10*(size_t) messageParameterEstimationMaximumDataLength };
// Error correction - Parities
std::vector<t_integer> parityIn{};
bool errCorrParitiesStarted{ false };
// Sindrome
t_integer messageSindromeMaximumDataLength{ 5000 };
CircularBuffer<t_binary> Sindrome{ messageSindromeMaximumDataLength };
// Error correction - Permutations
std::vector<t_integer> permutationsIn{};
bool errCorrPermStarted{ false };
// Error correction - BER
std::vector<t_integer> errCorrBerIn{};
bool errCorrBerStarted{ false };
// Privacy amplification seeds
std::vector<t_integer> privacySeedsIn{};
bool privacySeedsStarted{ false };
bool outputReceivedData(std::vector <t_integer>& dataVector, Signal& outputSignal, bool &started);
};
#endif // !MESSAGE_PROCESSOR_RECEIVER_H_
父类定义为:
class Block {
public:
/* Methods */
Block(){};
Block(std::vector<Signal*> &InputSig, std::vector<Signal*> &OutputSig);
Block(std::initializer_list<Signal*> InputSig, std::initializer_list<Signal*> OutputSig); // since C++11
//void initializeBlock(std::vector<Signal*> InputSig, vector<Signal*> OutputSig);
void initializeBlock();
virtual void initialize(void) {};
//bool runBlock();
virtual bool runBlock();
void terminateBlock();
virtual void terminate(void) {};
void closeOutputSignals();
void setNumberOfInputSignals(int nOfInputSignal) { numberOfInputSignals = nOfInputSignal; };
int getNumberOfInputSignals() { return numberOfInputSignals; };
void setNumberOfOutputSignals(int nOfOutputSignal) { numberOfOutputSignals = nOfOutputSignal; };
int getNumberOfOutputSignals() { return numberOfOutputSignals; };
void setLogValue(bool lValue) { logValue = lValue; }
bool getLogValue() { return logValue; }
void setFirstRun(bool fRun) { firstRun = fRun; }
bool getFirstRun() { return firstRun; }
void setFirstTime(bool fTime) { firstTime = fTime; }
bool getFirstTime() { return firstTime; }
void setTerminated(bool t) { terminated = t; }
bool getTerminated() { return terminated; }
std::string getSignalsFolderName();
void setVerboseMode(t_bool vMode) { verboseMode = vMode; }
t_bool getVerboseMode(void) { return verboseMode; }
void setVerboseFolderName(t_string vFolderName) { verboseFolderName = vFolderName; }
t_string getVerboseFolderName(void) const { return verboseFolderName; }
std::vector<Signal *> inputSignals;
std::vector<Signal *> outputSignals;
private:
bool logValue{ true };
bool firstRun{ true }; // To be deleted, 2020/02/04, the name firstTime is more comum
bool firstTime{ true };
bool terminated{ false };
t_bool verboseMode{ true };
int numberOfInputSignals{ 1 };
int numberOfOutputSignals{ 1 };
t_string verboseFolderName{ "verbose" };
};
当我在终端中制作时,我收到以下错误:
undefined reference to `vtable for DvQkdLdpcTxMessageProcessorReceiver'
我该如何解决?我搜索了很多关于错误的信息(我试图找到纯虚方法或内联函数和......),但没有结果。谢谢你。
解决方案
推荐阅读
- xero-api - 如何避免在 Xero Payroll API 中创建重复的员工?
- slack - slackbot 上传文件时无法访问文件(url_private 属性)
- javascript - 如何从字节数组转换为以javascript开头的任意字节开始的不同数字类型
- typescript - 预期打字稿 eslint 解析错误“]”
- python - 为什么 codechef 的 Python 3.6 编译器反复提到 EOF 错误?但是在 PyCharm 中,这段代码可以正常工作
- sql - 如何在 Firebird 表上创建默认约束以分配自动生成的 UUID 值
- python - 连接和读取modbus协议
- amazon-web-services - 同时对两个 SNS 事件进行 Lambda 调用
- r - 使用目录运行闪亮的文档
- javascript - 使用复选框显示/隐藏动态 div 不起作用