Error during Mex compilation

1 次查看(过去 30 天)
RAKESH
RAKESH 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