C ++ | 3x链接器错误LNK2028,2019,1120 |构造函数

时间:2017-06-27 14:41:54

标签: c++ visual-c++ constructor linker linker-errors

当我启动Windows桌面c ++ clr项目时,我收到3个链接器错误。我正在使用Mobotix的事件流客户端API(http://developer.mobotix.com/)。

错误:

error LNK2028: not listed token (0A000429) ""public: virtual __thiscall ie::MxPEG::MxPEG_SinkVideo::~MxPEG_SinkVideo(void)" (??1MxPEG_SinkVideo@MxPEG@ie@@$$FUAE@XZ)", wich is linked in function ""public: __thiscall SinkVideo::SinkVideo(char const *)" (??0SinkVideo@@$$FQAE@PBD@Z)". C:\Users\Hecom\Documents\Visual Studio 2012\Projects\HKS\HKS\SinkVideo.obj    HKS

error LNK2019: link to not listed external symbol ""public: virtual __thiscall ie::MxPEG::MxPEG_SinkVideo::~MxPEG_SinkVideo(void)" (??1MxPEG_SinkVideo@MxPEG@ie@@$$FUAE@XZ)" in function ""public: __thiscall SinkVideo::SinkVideo(char const *)" (??0SinkVideo@@$$FQAE@PBD@Z)".    C:\Users\Hecom\Documents\Visual Studio 2012\Projects\HKS\HKS\SinkVideo.obj  HKS

error LNK1120: 2 not listed externs C:\Users\Hecom\Documents\Visual Studio 2012\Projects\HKS\Debug\HKS.exe  HKS

...我将此错误代码翻译成英文,因为我正在运行德语版的Visual Studio。

当我在SinkVideo.cpp中注释掉以下构造函数时,不再有错误:

SinkVideo::SinkVideo (const char *outFile) {
}

如您所见,构造函数为空。那么,为什么会导致这个错误? 这可能是API中的错误吗?

标题文件(SinkVideo.h):

#include <Windows.h>

#include "MxPEG_SinkVideo.hpp"
#include "MxPEG_Image.hpp"
#include "MxPEG_Defines.hpp"

using namespace ie::MxPEG;

class SinkVideo : public MxPEG_SinkVideo {
public:
    SinkVideo (const char *outFile);

protected:
    virtual
        MxPEG_ReturnCode doConsumeVideo(MxPEG_Image *buffer);

private:
    FILE * fVideoOut;
};

Source-File(SinkVideo.cpp):

#include "SinkVideo.h"

#include <assert.h>
#include <stdio.h>

#include <fcntl.h>
#include <io.h>


SinkVideo::SinkVideo (const char *outFile) {
    // the constructor which causes the errors
}

MxPEG_ReturnCode SinkVideo::doConsumeVideo(MxPEG_Image *buffer) {

    return er_Success;
}

以下是API中MxPEG_SinkVideo.hpp头文件的代码:

#ifndef MXPEG_SRC_MXPEG_SINK_HPP_
#define MXPEG_SRC_MXPEG_SINK_HPP_

#include "MxPEG_Image.hpp"

namespace ie { namespace MxPEG
{

/*
 * Interface of the Vido Sink.
 *
 * Pass an instance of this to the constructor when creating an instance of MxPEG_SDK(). The SDK will pass all decoded video frames to the doConsumeVideo()
 * function of that instance.
 *
 */
class MxPEG_SinkVideo
{

protected:

public:

   virtual
   ~MxPEG_SinkVideo();

   MxPEG_ReturnCode consumeVideo(MxPEG_Image *buffer);

protected:
   friend class MxPEG_SinkSynchronized;

   /*
    * Receives each video frame right after it was decoded. Either YUV or RGB is possible (see MxPEG_Image.hpp and MxPEG_SDK_API.hpp)
    *
    * doConsumeVideo needs to take care of deleting the buffer once it is no longer needed.
    */
   virtual
   MxPEG_ReturnCode doConsumeVideo(MxPEG_Image *buffer) = 0;

};

} } /* namespace ie::MxPEG */

#endif /* MXPEG_SRC_MXPEG_SINK_HPP_ */

0 个答案:

没有答案