在Octave上运行mex命令的问题

时间:2018-11-15 15:07:26

标签: matlab octave mex

我正在使用Ubuntu,正在尝试使用Octave运行Matlab脚本,该脚本在某些cpp文件上运行mex编译器https://github.com/yuxng/MDP_Tracking/blob/master/compile.m我已经安装了OpenCV要求,但收到一些错误。

基本上八度的命令是

compile
MOT_test

我从compile命令获得的错误如下所示。根据我的Google搜索以及该线程Mex file building with Octave (issue with wrappers),似乎仍未解决编译MDP Tracker的问题。我在运行mex和octave方面有几分钟的经验,因此除了询问外,我无能为力。我希望在这里得到一些帮助。谢谢!

octave:4> compile
In file included from imResampleMex.cpp:7:0:
wrappers.hpp:22:24: error: ‘wrCalloc’ declared as an ‘inline’ variable
 inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
                        ^~~~~~
wrappers.hpp:22:24: error: ‘size_t’ was not declared in this scope
wrappers.hpp:22:36: error: ‘size_t’ was not declared in this scope
 inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
                                    ^~~~~~
wrappers.hpp:22:48: error: expression list treated as compound expression in initializer [-fpermissive]
 inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
                                                ^
wrappers.hpp:23:24: error: ‘wrMalloc’ declared as an ‘inline’ variable
 inline void* wrMalloc( size_t size ) { return malloc(size); }
                        ^~~~~~
wrappers.hpp:23:24: error: ‘size_t’ was not declared in this scope
wrappers.hpp: In function ‘void wrFree(void*)’:
wrappers.hpp:24:44: error: ‘free’ was not declared in this scope
 inline void wrFree( void * ptr ) { free(ptr); }
                                            ^
wrappers.hpp: At global scope:
wrappers.hpp:29:17: error: ‘size_t’ was not declared in this scope
 void* alMalloc( size_t size, int alignment ) {
                 ^~~~~~
wrappers.hpp:29:30: error: expected primary-expression before ‘int’
 void* alMalloc( size_t size, int alignment ) {
                              ^~~
wrappers.hpp:29:44: error: expression list treated as compound expression in initializer [-fpermissive]
 void* alMalloc( size_t size, int alignment ) {
                                            ^
imResampleMex.cpp: In function ‘void resampleCoef(int, int, int&, int*&, int*&, T*&, int*, int)’:
imResampleMex.cpp:22:39: error: ‘alMalloc’ cannot be used as a function
   wts = (T*)alMalloc(nMax*sizeof(T),16);
                                       ^
imResampleMex.cpp:23:43: error: ‘alMalloc’ cannot be used as a function
   yas = (int*)alMalloc(nMax*sizeof(int),16);
                                           ^
imResampleMex.cpp:24:43: error: ‘alMalloc’ cannot be used as a function
   ybs = (int*)alMalloc(nMax*sizeof(int),16);
                                           ^
imResampleMex.cpp: In function ‘void resample(T*, T*, int, int, int, int, int, T)’:
imResampleMex.cpp:49:43: error: ‘alMalloc’ cannot be used as a function
   T *C = (T*) alMalloc((ha+4)*sizeof(T),16); for(y=ha; y<ha+4; y++) C[y]=0;
                                           ^
warning: mkoctfile exited with failure status
warning: called from
    mkoctfile at line 171 column 5
    mex at line 29 column 18
    compile at line 17 column 2
Compilation finished.
octave:5>

0 个答案:

没有答案