Include external libraries in Mex files
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
James Tursa
el 2 de Jul. de 2015
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.
Respuestas (0)
Ver también
Categorías
Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!