[mlabwrap-user] mlabraw.cpp (mlabwrap-1.1) gcc error -- please help!
Status: Beta
Brought to you by:
aschmolck
|
From: Jorge O. <jo...@or...> - 2011-04-05 14:37:33
|
mlabwrap-1.1 | Ubuntu 10.10 | Matlab 7.11.10 numpy is installed, matlab bin is on path. So I'm trying # python setup.py install but this compile error (plus a bunch of similar warnings) is driving me crazy : running install running build running build_py creating build creating build/lib.linux-i686-2.6 copying mlabwrap.py -> build/lib.linux-i686-2.6 copying awmstools.py -> build/lib.linux-i686-2.6 running build_ext building 'mlabrawmodule' extension creating build/temp.linux-i686-2.6 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -D_V6_5_OR_LATER=1 -I/usr/local/MATLAB/R2010b/extern/include -I/usr/lib/python2.6/dist-packages/numpy/core/include -I/usr/include/python2.6 -c mlabraw.cpp -o build/temp.linux-i686-2.6/mlabraw.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ mlabraw.cpp: In function ‘PyArrayObject* mx2numeric(const mxArray*)’: mlabraw.cpp:225: *error*: invalid conversion from ‘const mwSize*’ to ‘const int*’ mlabraw.cpp: In function ‘mxArray* makeMxFromNumeric(const PyArrayObject*)’: mlabraw.cpp:365: *error*: invalid conversion from ‘int*’ to ‘const mwSize*’ mlabraw.cpp:365: *error*: initializing argument 2 of ‘mxArray* mxCreateNumericArray(mwSize, const mwSize*, mxClassID, mxComplexity)’ mlabraw.cpp: In function ‘mxArray* numeric2mx(PyObject*)’: mlabraw.cpp:509: warning: deprecated conversion from string constant to ‘char*’ mlabraw.cpp: In function ‘PyObject* mlabraw_open(PyObject*, PyObject*)’: mlabraw.cpp:570: warning: deprecated conversion from string constant to ‘char*’ mlabraw.cpp: In function ‘PyObject* mlabraw_eval(PyObject*, PyObject*)’: mlabraw.cpp:631: warning: deprecated conversion from string constant to ‘char*’ mlabraw.cpp:662: warning: deprecated conversion from string constant to ‘char*’ mlabraw.cpp: In function ‘void initmlabraw()’: mlabraw.cpp:895: warning: deprecated conversion from string constant to ‘char*’ error: command 'gcc' failed with exit status 1 It seems gcc is not handling the mwSize type -> int type in C++ (According to Mathworks they shold be equivalent, see http://www.mathworks.com/help/techdoc/apiref/mwsize.html) ... and I have no idea how to fix this, it sounds like an easy thing to fix if you know C and gcc well. Anyone? THANKS! This is the line 225 in malbraw.cpp for further ref: dims = mxGetDimensions(pArray); dims is declared in the previous line: const mwSize *dims; mwSize is just an alias for int (#define mwSize int macro in line 145) BUT mxGetDimensions() also returns a mwSize type, defined somewhere in Matlab's C-interface code ( matrix.h ? ) and these two are not checking out it seems! Or perhaps the problem is not what I think it is. ANY HELP WILL BE APPRECIATED! -Jorge |