devmax / randomforest-matlab

Automatically exported from code.google.com/p/randomforest-matlab
0 stars 0 forks source link

Can't compile in Windows nor Unix #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When compiling using the .m script files provided with MS Visual Studio 2010's 
cl on a PCWIN64 machine or with g++ on a Unix64 machine, I get several errors 
like the following:

src\mex_ClassificationRF_train.cpp(179) : error C2664: 
'mxCreateNumericMatrix_730' : cannot convert parameter 4 from 'int' to 
'mxComplexity'. Conversion to enumeration type requires an explicit cast 
(static_cast, C-style cast or function-style cast) 

My understanding is that C++ does not support implicit casting from int to enum 
types. I also tried using OPTIMFLAGS="$OPTIMFLAGS /Tc" in mex but the code does 
not seem to be C compatible either.

Original issue reported on code.google.com by AmelioVa...@gmail.com on 31 Jan 2011 at 12:41

GoogleCodeExporter commented 9 years ago
hmm, i never had those problems. Might be the compilers i am using are a bit 
lenient in these regards ( i used visual c++ express on windows and g++ on 
linux amd64)

I did the necessary changes from 0 to mxREAL for the mxCreate* and the code is 
in svn. 

Please do tell if you get any other errors.

Original comment by abhirana on 31 Jan 2011 at 6:52

GoogleCodeExporter commented 9 years ago
I'm using VS10 and I've resolved the problem as following: In the 'classRF.cpp' 
file, simply change all the 'near' int variables with another name, for example 
'nearr' . In fact the VS10 compiler doesn't like this name for a int variable, 
maybe because it is a key word. Byeee

Original comment by mettb...@gmail.com on 16 Mar 2011 at 3:31