playerkk / drfi_matlab

MATLAB implementation of the paper Salient Object Detection: A Discriminative Regional Feature Integration Approach
50 stars 26 forks source link

some problems when compiling #4

Open corwinliu9669 opened 5 years ago

corwinliu9669 commented 5 years ago

when i try to compile, there are some errors for mex src/cokus.cpp src/reg_RF.cpp src/mex_regressionRF_train.cpp -DMATLAB -output mexRF_train

错误使用 mex /Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:124:15: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[8] = mxCreateNumericMatrix(n_size, 1, mxDOUBLE_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:131:20: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[10] = mxCreateNumericMatrix(p_size, 2, mxDOUBLE_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:136:20: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[10] = mxCreateNumericMatrix(p_size, 1, mxDOUBLE_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:144:20: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[11] = mxCreateNumericMatrix(p_size, n_size, mxDOUBLE_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:149:20: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[11] = mxCreateNumericMatrix(1, 1, mxDOUBLE_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:158:20: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[12] = mxCreateNumericMatrix(p_size, 1, mxDOUBLE_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:163:20: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[12] = mxCreateNumericMatrix(1, 1, mxDOUBLE_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:177:20: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[13] = mxCreateNumericMatrix(n_size,n_size,mxDOUBLE_CLASS,0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:180:20: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[13] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:187:15: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[7] = mxCreateNumericMatrix(ntree, 1, mxINT32_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:193:15: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[2] = mxCreateNumericMatrix(nrnodes, nt, SMALL_INT_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:199:15: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[0] = mxCreateNumericMatrix(nrnodes, nt, mxINT32_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:205:15: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[1] = mxCreateNumericMatrix(nrnodes, nt, mxINT32_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:211:15: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[5] = mxCreateNumericMatrix(nrnodes, nt, mxDOUBLE_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:217:15: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[6] = mxCreateNumericMatrix(nrnodes, nt, mxINT32_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:223:15: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[4] = mxCreateNumericMatrix(nrnodes, nt, mxDOUBLE_CLASS, 0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:227:15: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[9] = mxCreateNumericMatrix(ntree,1,mxDOUBLE_CLASS,0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:253:16: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[14] = mxCreateNumericMatrix(2,1,mxDOUBLE_CLASS,0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

/Users/corwinliu/Documents/MATLAB/drfi_matlab-master/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp:258:16: error: no matching function for call to 'mxCreateNumericMatrix_730' plhs[15] = mxCreateNumericMatrix(n_size,1,mxINT32_CLASS,0); ^~~~~ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^~~~~~~~~~~~~~~~~~~~~~~~~

/Applications/MATLAB_R2018b.app/extern/include/matrix.h:1207:1: note: candidate function not viable: no known conversion from 'int' to 'mxComplexity' for 4th argument mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag); ^ /Applications/MATLAB_R2018b.app/extern/include/matrix.h:315:31: note: expanded from macro 'mxCreateNumericMatrix'

define mxCreateNumericMatrix mxCreateNumericMatrix_730

                          ^

fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.

出错 compile (line 11) mex src/cokus.cpp src/reg_RF.cpp src/mex_regressionRF_train.cpp -DMATLAB -output mexRF_train

alisa0626 commented 5 years ago

Have you solved the problem?I make a trouble with the same problem.

Po-Hsuan-Huang commented 4 years ago

Same problem. The compile.m was only tested on MatLab2012, not 2018. Have you tried downgrade your Matlab ?

rainyfly commented 4 years ago

I have the same problem. Maybe downgrade the Matlab could help, but anyone knows how to modify the source code to correct this error? Downgrading is so annoying.

rainyfly commented 4 years ago

I analysed the error report and solved this problem now. the function prototype is "mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag)", and the type of mxComplexity is enum. According to the Matlab Document, mxComplexity is "typedef enum mxComplexity {mxREAL=0, mxCOMPLEX}", so you replace the 4th argument '0' with 'mxREAL' , it can be compiled successfully.

YudeWang commented 4 years ago

Thanks the solution given by @rainyfly, modify the mxCreateNumericMatrix function in drfi_matlab/ranodmforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp and mex_regressionRF_predict.cpp works for me on Ubuntu 16.04 with matlab2017b.