help > Compiling problems
Mar 21, 2018  01:03 AM | ericb
Compiling problems
Hello,

I am hoping to try out this tool box for WMH. However, I am having trouble with the compiler script.

Running Ubuntu 17.10 and Matlab 2018a, there is a bit of an issue where the only approved compiler is gcc 6.3, yet that is not available for Ubuntu 17.10. Running with either gcc 6.4 or 7.2, I get an error.

Specifically trying to compile  RegionGrowing_mex.cpp, I get the error pasted below.

Please let me know if you have any suggested workarounds.

Thanks very much.

>> mex RegionGrowing_mex.cpp
Building with 'g++'.
Warning: You are using gcc version '7.2.0'. The version of gcc is not supported. The
version currently supported with MEX is '6.3.x'. For a list of currently supported
compilers see: .
Error using mex
/usr/local/MATLAB/R2018a/toolbox/W2MHS/RegionGrowing_mex.cpp: In function 'void
mexFunction(int, mxArray**, int, const mxArray**)':
/usr/local/MATLAB/R2018a/toolbox/W2MHS/RegionGrowing_mex.cpp:167:47: error: cannot
convert 'const mwSize* {aka const long unsigned int*}' to 'const int*' in
initialization
const int* pSize = mxGetDimensions(prhs[0]);

^
/usr/local/MATLAB/R2018a/toolbox/W2MHS/RegionGrowing_mex.cpp:201:74: error: cannot
convert 'const int*' to 'const mwSize* {aka const long unsigned int*}' for argument
'2' to 'mxArray* mxCreateNumericArray_730(mwSize, const mwSize*, mxClassID,
mxComplexity)'
plhs[0] = mxCreateNumericArray(lNDims, pSize, mxLOGICAL_CLASS, mxREAL); //
create output array
^
/usr/local/MATLAB/R2018a/toolbox/W2MHS/RegionGrowing_mex.cpp:203:102: error: cannot
convert 'const int*' to 'const mwSize* {aka const long unsigned int*}' for argument
'2' to 'mxArray* mxCreateNumericArray_730(mwSize, const mwSize*, mxClassID,
mxComplexity)'
bool *pbCandidate = (bool*) mxGetData(mxCreateNumericArray(lNDims, pSize,
mxLOGICAL_CLASS, mxREAL)); // create output array

Threaded View

TitleAuthorDate
Compiling problems
ericb Mar 21, 2018
ericb Mar 21, 2018
ericb Mar 22, 2018
Vamsi Ithapu Mar 22, 2018