Felzenszwalb-Segmentation icon indicating copy to clipboard operation
Felzenszwalb-Segmentation copied to clipboard

error with unknown mex argument

Open NerminSalem opened this issue 7 years ago • 6 comments

hii i m trying to run yr interesting tool on matlab 2015 but when compiling compileFelzenszwalbSegmentation.m i got this error: Error using mex Unknown MEX argument '-o'.

Error in compileFelzenszwalbSegmentation (line 4) mex -O segmentFelzenszwalb.cpp -o segmentFelzenszwalb can u help?

NerminSalem avatar Apr 20 '17 09:04 NerminSalem

changing -o to -output should work from Matlab R2014 onwards.

raghavkhanna avatar Jul 14 '17 16:07 raghavkhanna

image i tried it but still got the same error

NerminSalem avatar Jul 17 '17 08:07 NerminSalem

The first one remains -O, only the second -o changes

raghavkhanna avatar Jul 17 '17 19:07 raghavkhanna

i did that but now i got the following error

compileFelzenszwalbSegmentation Building with 'g++'. Warning: You are using gcc version '5.4.0'. The version of gcc is not supported. The version currently supported with MEX is '4.9.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release. In compileFelzenszwalbSegmentation (line 4) Error using mex /home/nermin/Felzenszwalb-Segmentation/segmentFelzenszwalb.cpp: In function ‘void mexFunction(int, mxArray**, int, const mxArray**)’: /home/nermin/Felzenszwalb-Segmentation/segmentFelzenszwalb.cpp:229:72: error: cannot convert ‘int*’ to ‘const size_t* {aka const long unsigned int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(size_t, const size_t*, mxClassID, mxComplexity)’ pOutput[0] = mxCreateNumericArray (3, dims, mxUINT8_CLASS, mxREAL); ^ /home/nermin/Felzenszwalb-Segmentation/segmentFelzenszwalb.cpp:279:74: error: cannot convert ‘int*’ to ‘const size_t* {aka const long unsigned int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(size_t, const size_t*, mxClassID, mxComplexity)’ pOutput[0] = mxCreateNumericArray (2, dims, mxUINT8_CLASS, mxREAL); ^ /home/nermin/Felzenszwalb-Segmentation/segmentFelzenszwalb.cpp:295:75: error: cannot convert ‘int*’ to ‘const size_t* {aka const long unsigned int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(size_t, const size_t*, mxClassID, mxComplexity)’ pOutput[0] = mxCreateNumericArray (2, dims, mxUINT16_CLASS, mxREAL); ^ /home/nermin/Felzenszwalb-Segmentation/segmentFelzenszwalb.cpp:317:70: error: cannot convert ‘int*’ to ‘const size_t* {aka const long unsigned int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(size_t, const size_t*, mxClassID, mxComplexity)’ pOutput[1] = mxCreateNumericArray(1,dims,mxUINT8_CLASS,mxREAL); ^ /home/nermin/Felzenszwalb-Segmentation/segmentFelzenszwalb.cpp:325:70: error: cannot convert ‘int*’ to ‘const size_t* {aka const long unsigned int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(size_t, const size_t*, mxClassID, mxComplexity)’ pOutput[1] = mxCreateNumericArray(1,dims,mxINT16_CLASS,mxREAL); ^

Error in compileFelzenszwalbSegmentation (line 4) mex -O segmentFelzenszwalb.cpp -output segmentFelzenszwalb

NerminSalem avatar Jul 17 '17 20:07 NerminSalem

You're using a newer version of gcc, as mentioned in the warning, that might be an issue

Warning: You are using gcc version '5.4.0'. The version of gcc is not supported. The version currently supported with MEX is
'4.9.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.

raghavkhanna avatar Jul 18 '17 09:07 raghavkhanna

How to compile this lib in Windows OS, there exist lots of errors? Can you provide a new version which support Windows? Thank!

jizhihang avatar Dec 27 '17 02:12 jizhihang