MEX compile type error
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!