C++ matlab中图形切割算法在前景减法中的编译错误

C++ matlab中图形切割算法在前景减法中的编译错误,c++,matlab,video,image-processing,video-processing,C++,Matlab,Video,Image Processing,Video Processing,在我大学的最后一个项目(与视频修复相关)中,我找到了一个与前景减法相关的Matlab代码。这是它的源代码。 当我在matlab中编译此源代码(我指的是gcut.cpp文件)时,我遇到了以下错误: Error using mex gcut.cpp e:\future\inpainting article\inpainting code\fgseg\fgseg\h_prf.cpp(183) : warning C4244: '=' : conversion from '__int64' to 'lo

在我大学的最后一个项目(与视频修复相关)中,我找到了一个与前景减法相关的Matlab代码。这是它的源代码。 当我在matlab中编译此源代码(我指的是gcut.cpp文件)时,我遇到了以下错误:

Error using mex
gcut.cpp
e:\future\inpainting article\inpainting code\fgseg\fgseg\h_prf.cpp(183) : warning C4244: '=' :
conversion from '__int64' to 'long', possible loss of data
E:\future\Inpainting Article\Inpainting Code\FGseg\FGseg\gcut.cpp(138) : warning C4267: '=' :
conversion from 'size_t' to 'long', possible loss of data
E:\future\Inpainting Article\Inpainting Code\FGseg\FGseg\gcut.cpp(144) : error C2440: '=' :
cannot convert from 'size_t *' to 'int *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or
    function-style cast
E:\future\Inpainting Article\Inpainting Code\FGseg\FGseg\gcut.cpp(145) : error C2440: '=' :
cannot convert from 'size_t *' to 'int *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or
    function-style cast
E:\future\Inpainting Article\Inpainting Code\FGseg\FGseg\gcut.cpp(287) : warning C4244: '=' :
conversion from '__int64' to 'long', possible loss of data
E:\future\Inpainting Article\Inpainting Code\FGseg\FGseg\gcut.cpp(346) : warning C4244: '=' :
conversion from '__int64' to 'long', possible loss of data
在收到这些错误后,经过考虑,我找到了问题的根源:(以下是产生问题的代码的基本部分)

最后经过上述修改: 我收到了以下错误:

mex -largeArrayDims gcut.cpp
Building with 'Microsoft Visual C++ 2010'.
Error using mex
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'
我怎样才能解决这个问题


很抱歉,我写得很糟糕。

您收到的错误消息不言自明。你看过代码了吗?嗨,伙计,我已经按照它的建议更改了代码,但是当它给我另一个错误时。你做了什么更改?你有什么新的错误?请编辑您的问题以反映此新信息。我编辑了我的问题!!!恐怕我不是
mex -largeArrayDims gcut.cpp
Building with 'Microsoft Visual C++ 2010'.
Error using mex
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'