SVM-struct MATLAB(windows)在matlab编译出现error C2059: 语法错误:“sizeof”,解决办法

看门见山:

SVM-struct MATLAB相关介绍及资源见如下两个链接:

http://www.robots.ox.ac.uk/~vedaldi//svmstruct.html#download-and-install

https://github.com/vedaldi/svm-struct-matlab/issues

出现如下错误:

SVM-struct MATLAB(windows)在matlab编译出现error C2059: 语法错误:“sizeof”,解决办法_第1张图片

解决办法:1. 注释掉 svm_light/svm_common.h 中第447行,即:—//int isnan(double a);

                  2. 注释掉 svm_light/svm_common.c 中第1773-1776行

如果接着报如下如下错误

SVM-struct MATLAB(windows)在matlab编译出现error C2059: 语法错误:“sizeof”,解决办法_第2张图片

解决办法如下(原因是你的matlab版本在2018b甚至更高):

                    1.在svm_struct_api.c文件中,将 mexSetTrapFlag 全部注释掉。
                    2 .将 mexCallMATLAB 替换为 mexCallMATLABWithTrap 即可运行。

ok,至此结束,enjoy yourself !

你可能感兴趣的:(SVM-struct MATLAB(windows)在matlab编译出现error C2059: 语法错误:“sizeof”,解决办法)