Error during Mex compilation

조회 수: 5 (최근 30일)
RAKESH
RAKESH 2014년 3월 14일
답변: James Tursa 2014년 3월 14일
Hello ALL,
I am getting error while doing Mex, need to know how it can be solved
mex MOD_sl_vl_voltage_limits.c
Error MOD_sl_vl_voltage_limits.c: .\gm_sme_code_gen_types.h: 49 invalid struct field declarations
Error MOD_sl_vl_voltage_limits.c: .\gm_sme_code_gen_types.h: 49 syntax error; found `uint8_t' expecting `}'
Error MOD_sl_vl_voltage_limits.c: .\gm_sme_code_gen_types.h: 49 skipping `uint8_t' `ACAN_IN_S_U08_St_SPEC_DCSW_HVSTO'
Error MOD_sl_vl_voltage_limits.c: .\gm_sme_code_gen_types.h: 49 empty declaration
Error MOD_sl_vl_voltage_limits.c: .\gm_sme_code_gen_types.h: 50 syntax error; found `ACAN_IN_S_U08_ACAN_RqCl_DcSw' expecting `;'
Error MOD_sl_vl_voltage_limits.c: .\gm_sme_code_gen_types.h: 65 syntax error; found `ACAN_IN_S_U08_St_V_VEH' expecting `;'
Error MOD_sl_vl_voltage_limits.c: .\gm_sme_code_gen_types.h: 66 too many errors
C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Compile of 'MOD_sl_vl_voltage_limits.c' failed.

답변 (2개)

James Tursa
James Tursa 2014년 3월 14일
It is possible the compiler you are using does not support the uint8_t type (or related types). If so, you might have to manually insert a define or typedef up front in the code for this. E.g.,
#define uint8_t unsigned char

Ken Atwell
Ken Atwell 2014년 3월 14일
This loos like am ordinary syntax error in your C header file. What does gm_sme_code_gen_types.h looks like around line 49?
It would also be helpful too know what compiler you are using, and whether you are using a 32- or 64-bit MATLAB version of MATLAB/compiler.

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by