error LNK2019: unresolved external symbol "public: __thiscall Matrix::Matrix(void)
4 次查看(过去 30 天)
显示 更早的评论
I try to MEX a C++ file( with extension .cc) in MATLAB 2013b, compiler Visual Studio 2012 professional, OS 32-bit Windows, I take below errors ;
if true
correspondPixels.obj : error LNK2019: unresolved external symbol "public: __thiscall Matrix::Matrix(void)" (??0Matrix@@QAE@XZ) referenced in function _mexFunction
correspondPixels.obj : error LNK2019: unresolved external symbol "public: __thiscall Matrix::Matrix(int,int,double *)" (??0Matrix@@QAE@HHPAN@Z) referenced in function _mexFunction
correspondPixels.obj : error LNK2019: unresolved external symbol "public: __thiscall Matrix::~Matrix(void)" (??1Matrix@@QAE@XZ) referenced in function _mexFunction
correspondPixels.obj : error LNK2019: unresolved external symbol "public: int __thiscall Matrix::numel(void)const " (?numel@Matrix@@QBEHXZ) referenced in function _mexFunction
correspondPixels.obj : error LNK2019: unresolved external symbol "public: double * __thiscall Matrix::data(void)" (?data@Matrix@@QAEPANXZ) referenced in function _mexFunction
correspondPixels.obj : error LNK2019: unresolved external symbol "double __cdecl matchEdgeMaps(class Matrix const &,class Matrix const &,double,double,class Matrix &,class Matrix &)" (?matchEdgeMaps@@YANABVMatrix@@0NNAAV1@1@Z) referenced in function _mexFunction
correspondPixels.mexw32 : fatal error LNK1120: 6 unresolved externals
C:\PROGRA~1\MATLAB\R2013B\BIN\MEX.PL: Error: Link of 'correspondPixels.mexw32' failed
end
I searched similar errors and try to apply some advising solutions but no-one helps me. Maybe there is an declared constructor but undefined function or unimplemented ones? Maybe due to a missing .dll file? I am familiar with MATLAB more. not much C++. Is there any solution idea?
0 个评论
回答(2 个)
Walter Roberson
2017-3-13
Class Matrix is not a standard C++ class; it is also not part of the common add-on "Boost".
0 个评论
doner_t
2017-3-13
2 个评论
Walter Roberson
2017-3-13
You could probably just mex everything together, but more common would be to compile the Matrix stuff into a shared library and use a -l switch on the mex command line to link in the library.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!