libelas: matlab wrapper 编译出问题

在尝试使用g++编译libelas的MATLAB包装器时遇到错误,涉及类型转换问题。错误出现在将'const size_t*'转换为'const int32_t*'以及'int32_t*'转换为'const size_t*'。解决方案是在mex命令中添加'-DMX_COMPAT_32'选项,以适应32位系统的兼容性问题。
摘要由CSDN通过智能技术生成

make
Building wrappers ...
Building with 'g++'.
Error using mex
/home/fupeng/workspace/libelas-master/matlab/elasMex.cpp: In function ‘void mexFunction(int, mxArray**, int, const mxArray**)’:
/home/fupeng/workspace/libelas-master/matlab/elasMex.cpp:90:50: error: cannot convert ‘const size_t* {aka const long unsigned
int*}’ to ‘const int32_t* {aka const int*}’ in initialization
   const int32_t *I_dims = mxGetDimensions(prhs[0]);
                                                  ^
/home/fupeng/workspace/libelas-master/matlab/elasMex.cpp:98:68: error: cannot convert ‘int32_t* {aka int*}’ to ‘const size_t*
{aka const long unsigned int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(size_t, const size_t*, mxClassID,
mxComplexity)’
   plhs[0]     = mxCreateNumericArray(2,D_dims,mxSINGLE_CLASS,mxREAL);
                                                                    ^
/home

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值