Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 目标C编译错误“;“初始化类型”没有匹配的构造函数;_C++_Objective C_Xcode - Fatal编程技术网

C++ 目标C编译错误“;“初始化类型”没有匹配的构造函数;

C++ 目标C编译错误“;“初始化类型”没有匹配的构造函数;,c++,objective-c,xcode,C++,Objective C,Xcode,我试图实现这段代码,但在Xcode中出现编译错误: “没有用于初始化“PlaybackDelegate”的匹配构造函数” “从不兼容的类型'PlaybackDelegate'分配给'PlaybackDelegate*'” 我复制/粘贴了一个有效示例中的代码。但我不明白为什么它在我的项目中不起作用 header file class PlaybackDelegate : public IDeckLinkVideoOutputCallback { DecklinkDevice*

我试图实现这段代码,但在Xcode中出现编译错误: “没有用于初始化“PlaybackDelegate”的匹配构造函数” “从不兼容的类型'PlaybackDelegate'分配给'PlaybackDelegate*'”

我复制/粘贴了一个有效示例中的代码。但我不明白为什么它在我的项目中不起作用

header file
class PlaybackDelegate : public IDeckLinkVideoOutputCallback
{
DecklinkDevice*             pDecklinkDevice;

public:
    PlaybackDelegate (DecklinkDevice* owner);

virtual HRESULT QueryInterface (REFIID iid, LPVOID *ppv) {return E_NOINTERFACE;}
virtual ULONG AddRef () {return 1;}
virtual ULONG Release () {return 1;}

virtual HRESULT ScheduledFrameCompleted (IDeckLinkVideoFrame* completedFrame, BMDOutputFrameCompletionResult result);
virtual HRESULT ScheduledPlaybackHasStopped ();
};
.mm文件

playerDelegate = new PlaybackDelegate(self, deckLinkOutput);

if (playerDelegate == NULL)
{
    //NSLog(@"fout completed frame callback");
    //fout
}


我在代码中看不到一个PlaybackDelegate构造函数包含两个参数……嗯,的确。。检查了这个2个小时,但它现在可以工作了。非常感谢
PlaybackDelegate::PlaybackDelegate (DecklinkDevice* owner)
{
pDecklinkDevice = owner;
}

HRESULT PlaybackDelegate::ScheduledFrameCompleted (IDeckLinkVideoFrame* completedFrame, BMDOutputFrameCompletionResult result)
{
    NSLog(@"Frame Completed");
return S_OK;
}

HRESULT PlaybackDelegate::ScheduledPlaybackHasStopped ()
{
return S_OK;
}