我正在尝试使用mex在Matlab上编译.cpp文件。 c ++代码中有opencv函数,我使用的是64位Mac。
我输入以下内容进行编译:
mex(['-I' '/usr/local/include'],['-L' '/usr/local/lib'],'trackFeaturePoints.cpp')
我认为这是包含库和包含opencv文件的方法,但它可能是错误的。
我收到以下错误:
Undefined symbols for architecture x86_64:
"cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:
_mexFunction in trackFeaturePoints.o
"cv::VideoCapture::get(int)", referenced from:
_mexFunction in trackFeaturePoints.o
"cv::VideoCapture::release()", referenced from:
_mexFunction in trackFeaturePoints.o
"cv::VideoCapture::VideoCapture(std::string const&)", referenced from:
_mexFunction in trackFeaturePoints.o
"cv::VideoCapture::~VideoCapture()", referenced from:
_mexFunction in trackFeaturePoints.o
"cv::VideoCapture::operator>>(cv::Mat&)", referenced from:
_mexFunction in trackFeaturePoints.o
"cv::_OutputArray::_OutputArray(cv::Mat&)", referenced from:
_mexFunction in trackFeaturePoints.o
"cv::calcOpticalFlowPyrLK(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::Size_<int>, int, cv::TermCriteria, int, double)", referenced from:
_mexFunction in trackFeaturePoints.o
"cv::Mat::deallocate()", referenced from:
_mexFunction in trackFeaturePoints.o
"cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)", referenced from:
_mexFunction in trackFeaturePoints.o
"cv::fastFree(void*)", referenced from:
_mexFunction in trackFeaturePoints.o
"vtable for cv::_InputArray", referenced from:
_mexFunction in trackFeaturePoints.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for cv::_OutputArray", referenced from:
_mexFunction in trackFeaturePoints.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
mex: link of ' "trackFeaturePoints.mexmaci64"' failed.
Unable to complete successfully.
有人可以帮忙吗?非常感谢你!