Closed ugurkart closed 7 years ago
When I tried to compile on my Ubuntu machine, I get this error:
Error using mex /home/ugurkart/Codebase/csr-dcf/mex_src/hog/gradientMex.cpp: In function ‘mxArray* mxCreateMatrix3(int, int, int, mxClassID, bool, void)’: /home/ugurkart/Codebase/csr-dcf/mex_src/hog/gradientMex.cpp:329:44: error: cannot convert ‘const int’ to ‘const size_t {aka const long unsigned int}’ for argument ‘2’ to ‘int mxSetDimensions(mxArray, const size_t, size_t)’ mxSetData(M,I); mxSetDimensions(M,dims,3); return M; ^ /home/ugurkart/Codebase/csr-dcf/mex_src/hog/gradientMex.cpp: In function ‘void checkArgs(int, mxArray, int, const mxArray*, int, int, int, int, int, int, int, mxClassID, void*)’: /home/ugurkart/Codebase/csr-dcf/mex_src/hog/gradientMex.cpp:339:48: error: cannot convert ‘const size_t {aka const long unsigned int}’ to ‘const int’ in assignment nDims = mxGetNumberOfDimensions(pr[0]); dims = mxGetDimensions(pr[0]); ^
Error in compile (line 9) mex gradientMex.cpp
Any idea about how to solve it ?
Found the solution:
In compile.m, adding a flag for 32 bits compatibility to line 9 did the trick
mex -DMX_COMPAT_32 gradientMex.cpp
When I tried to compile on my Ubuntu machine, I get this error:
Error using mex /home/ugurkart/Codebase/csr-dcf/mex_src/hog/gradientMex.cpp: In function ‘mxArray* mxCreateMatrix3(int, int, int, mxClassID, bool, void)’: /home/ugurkart/Codebase/csr-dcf/mex_src/hog/gradientMex.cpp:329:44: error: cannot convert ‘const int’ to ‘const size_t {aka const long unsigned int}’ for argument ‘2’ to ‘int mxSetDimensions(mxArray, const size_t, size_t)’ mxSetData(M,I); mxSetDimensions(M,dims,3); return M; ^ /home/ugurkart/Codebase/csr-dcf/mex_src/hog/gradientMex.cpp: In function ‘void checkArgs(int, mxArray, int, const mxArray*, int, int, int, int, int, int, int, mxClassID, void*)’: /home/ugurkart/Codebase/csr-dcf/mex_src/hog/gradientMex.cpp:339:48: error: cannot convert ‘const size_t {aka const long unsigned int}’ to ‘const int’ in assignment nDims = mxGetNumberOfDimensions(pr[0]); dims = mxGetDimensions(pr[0]); ^
Error in compile (line 9) mex gradientMex.cpp
Any idea about how to solve it ?