drfi_matlab icon indicating copy to clipboard operation
drfi_matlab copied to clipboard

some problems when compiling

Open corwinliu9669 opened this issue 7 years ago • 5 comments

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

corwinliu9669 avatar Sep 20 '18 13:09 corwinliu9669

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

alisa0626 avatar Jan 17 '19 11:01 alisa0626

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

Po-Hsuan-Huang avatar Aug 01 '19 15:08 Po-Hsuan-Huang

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 avatar Aug 08 '19 07:08 rainyfly

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.

rainyfly avatar Aug 08 '19 08:08 rainyfly

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.

YudeWang avatar Dec 05 '19 03:12 YudeWang