MEX compile type error
이전 댓글 표시
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
채택된 답변
추가 답변 (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!