Issues running mex commands on Octave

Deadly 提交于 2019-12-24 10:22:36

问题


I am using Ubuntu and am trying to use Octave to run a Matlab script that runs the mex compiler on some cpp files https://github.com/yuxng/MDP_Tracking/blob/master/compile.m I have the OpenCV requirement already installed but am receiving some errors.

Basically the commands in octave are

compile
MOT_test

The errrors I got from the compile command are shown below. Based on my google search plus this thread Mex file building with Octave (issue with wrappers) it seems like this issue of compiling the MDP Tracker remains unsolved. I have minutes of experience running mex and octave so there is not much that I can do other than ask. I hope to get some help here. Thanks !

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>

来源:https://stackoverflow.com/questions/53322370/issues-running-mex-commands-on-octave

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!