S Function Error while generationg mex file

조회 수: 2 (최근 30일)
Sunu
Sunu 2013년 4월 29일
I have a header file with a prototype of a function( myfunc)and a function ponter to it. The c code generated with call through the function pointer to the myfunc inside the s19 file.
I get the following error while doing the legacy_code('compile', def) Error EH_fltPOW_flt_flt.c: 184 operands of = have illegal types `float' and `pointer to float function(float,float)' .
  댓글 수: 3
Sunu
Sunu 2013년 5월 1일
편집: Kaustubha Govind 2013년 5월 1일
def.OutputFcnSpec='single y1=EH_fltPOW_flt_flt(single u1, single u2)'
def.HeaderFiles={'myfunction.h'}
myfunction.h has
typedef float (*EH_fltPOW_flt_flt_type)(float, float);
#define EH_fltPOW_flt_flt ((EH_fltPOW_flt_flt_type)(0x66f74));
legacy_code('sfcn_cmex_generate', def); legacy_code('compile', def);
thats when I get the error mentioned
Kaustubha Govind
Kaustubha Govind 2013년 5월 1일
Seems like there might be a problem with how the function pointer is defined. Are you able to write and compile C code separately that attempts to call into the function-pointer? If so, how do you call into it?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Verification, Validation, and Test에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by