Include external libraries in Mex files
古いコメントを表示
I am just playing around with mex files and wish to call an external library in a mex file. I have this code and some more after it. The linking fails even though I include everything in the -I -L and -i options.
#include "gdcmImageReader.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
char *filename;
filename = mxArrayToString(prhs[0]);
gdcm::ImageReader reader;
reader.SetFileName( filename );
then when I compile I get something like this
error LNK2019: unresolved external symbol "public: void __cdecl gdcm::Reader::SetFileName(char const *)" (?SetFileName@Reader@gdcm@@QEAAXPEBD@Z) referenced in function mexFunction
Are you allowed to call external libraries?
2 件のコメント
James Tursa
2015 年 7 月 2 日
You need to show us the exact commands you are using to mex the code. What you are currently doing is not linking in the necessary libraries.
Muser10101010
2015 年 7 月 2 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Write C Functions Callable from MATLAB (MEX Files) についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!