MEX compile type error
Mostrar comentarios más antiguos
Hi guys,
MATLAB Version 7.12.0.635 (R2011a) 32-bit Windows
I am working with some (very cool!) code for texture synthesis and have it working OK, though MATLAB is asking for a .c file to be compiled. I have researched the process, and after pointing MATLAB to the correct folder, I ran the "mex innerProd.c" command, and it threw two errors, first it was looking for "strings.h", which I fixed by manually changing that to "string.h" in the .c file, but there is a second error that I cannot work out. Below is the error and the code I think it is pointing to.
EDU>> mex innerProd.c
Error innerProd.c: 36 type error in argument 2 to `sprintf'; found `int' expected `pointer to const char'
1 errors, 0 warnings
C:\PROGRA~2\MATLAB\R2011A~1\BIN\MEX.PL: Error: Compile of 'innerProd.c' failed.
??? Error using ==> mex at 208
Unable to complete successfully.
Here are lines 35-37 of innerprod.c
if (plhs[0] == NULL)
mexErrMsgTxt(sprintf("Error allocating %dx%d result matrix",wid,wid));
res = mxGetPr(plhs[0]);
Any help would be greatly appreciated.
Cheers, Alex
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!