error using mex while running svm struct

조회 수: 2 (최근 30일)
Luise
Luise 2023년 5월 30일
답변: Raghav 2023년 8월 4일
Hello,
I just started with Matlab and have a problem istalling the following package.
I am using MATLAB R2023a and I try to install A MATLAB wrapper of SVMstruct, A. Vedaldi, http://www.vlfeat.org/~vedaldi/code/svm-struct-matlab.html, 2008..
Therefore I downloaded the Git repository and Visual C. After run the followin command:
run('//.../svm-struct-matlab-master/makefile_windows.m')
I got the following error:
doing hideo
Building with 'Microsoft Visual C++ 2022 ©'.
Error using mex
svm_hideo.c
\\...svm-struct-matlab-master\svm_light\svm_common.h(447): error C2059: Syntaxfehler: "sizeof"
Error in makefile windows (line 3)
mex -largeArrayDims -c -DWIN ./svm_light/svm_hideo.c
Error in run (line 91)
evalin('caller', strcat(script, ';'));
Thank everyone for your help.

답변 (1개)

Raghav
Raghav 2023년 8월 4일
Hi Luise,
The error you encountered suggests that there is a syntax error in the file “svm_common.h” located in the svm_light directory of the SVMstruct MATLAB wrapper. This error is related to the use of the “sizeof” operator in that file.
To resolve this issue, you can try the following steps:
  1. Open the file svm_common.h located in the svm_light directory.
  2. Find the line that contains the “sizeof” operator and check for any syntax errors or inconsistencies.
  3. Make sure that the syntax of the “sizeof” operator is correct. It should be in the form “sizeof(type)”.
  4. Save the file after making any necessary corrections.
Once you've made the changes, try running the “makefile_windows.m” script again. If the error persists, please provide more information about the specific line in “svm_common.h” since that is causing the error.
Hope it helps,
Best Regards,
Raghav Bansal
MathWorks Technical Support

카테고리

Help CenterFile Exchange에서 Software Development Tools에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by