【发布时间】:2015-12-24 19:10:53
【问题描述】:
我想用 Matlab R2015b 编译以下代码"
#include "mex.h"
#include "GLTree.cpp"
/* the gateway function */
//la chiamata deve essere DeleteGLtree(Tree)
void mexFunction( int nlhs,const mxArray *plhs[],
int nrhs, const mxArray *prhs[1]) {
//dichiarazione variabili
GLTREE* Tree;
double *ptrtree;
if(nrhs!=1){ mexErrMsgTxt("Only one input supported.");}
ptrtree = mxGetPr(prhs[0]);//puntatore all'albero precedentemente fornito
Tree=(GLTREE*)((long)(ptrtree[0]));//ritrasformo il puntatore passato
if(Tree==NULL)
{ mexErrMsgTxt("Invalid tree pointer");
}
//chiamo il distruttore
delete Tree; }
但我收到此错误“C:\Users\Admin\Documents\MATLAB\GraphSeg\GLtree3DMex\DeleteGLTree.cpp:15:38: 警告:从不同大小的整数转换为指针 [-Wint-to-pointer-投掷] 树=(GLTREE*)((long)(ptrtree[0]));"
【问题讨论】:
-
那么问题是什么?
-
@EluciusFTW 如何使用 Matlab R2015b 64 位成功编译代码?