error LNK2019: unresolved external symbol "public: __thiscall Matrix::Matrix(void)
Ältere Kommentare anzeigen
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?
Antworten (2)
Walter Roberson
am 13 Mär. 2017
0 Stimmen
Class Matrix is not a standard C++ class; it is also not part of the common add-on "Boost".
doner_t
am 13 Mär. 2017
2 Kommentare
Walter Roberson
am 13 Mär. 2017
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.
doner_t
am 14 Mär. 2017
Kategorien
Mehr zu Build MATLAB Interface to C/C++ Library finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!