This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320C6678: failed to make MEX file for our custom function

Part Number: TMS320C6678

Tool/software: TI C/C++ Compiler

hello

we try to generate MEX file from our own custom library so that we can send MEX files to system designer. this way we hope they could check performance of our library without any hardware.

to do this we used latest version of c_intrinsics_host_port as used in the link below:

"processors.wiki.ti.com/.../Run_Intrinsics_Code_Anywhere"

we followed instruction mentioned in "processors.wiki.ti.com/.../MexExample"  and modified that example so we could generate MEX file for our own library rather than TI DSP library.

here is the problem:

one of our custom library file needs <c6x.h> to be included at top of the file. so we add "C:\ti\ccsv5\tools\compiler\c6000_7.4.1\include" to the list of "include folders" that mex command will use. here is our final MEX command:

mex -g -output ./mexExecFile C:/ti/c_intrinsics_host_port/c6xsim//C6xSimulator.c C:/ti/c_intrinsics_host_port/c6xsim//C66_ag_intrins.c C:/ti/c_intrinsics_host_port/c6xsim//C66_data_sim.c .//matlabEntry.c E:/[project Directory]/libSource/Process/FFT/Source/fftAux.c E:/[project Directory]/libSource/Process/FFT/Source/fft.c  -IC:/ti/c_intrinsics_host_port/c6xsim/ -IE:/[project Directory]/ -I./ -IC:/ti/ccsv5/tools/compiler/c6000_7.4.1/include/ -DTMS320C66X -D_TMS320C6600 -DLITTLE_ENDIAN_HOST -D_LITTLE_ENDIAN -DIS_FOR_MEX

in above command matlabEntry.c has same role as mexFftDspLib.c in "processors.wiki.ti.com/.../MexExample" and constant IS_FOR_MEX defined by us to fine tune some parameter during mex compilation. also note that we don't have any functionality implemented inside matlabEntry.c to keep things simple, the only thing in matlabEntry.c are necessary headers and matlab mexFunction().

after executing above command in matlab 2015b we receive these errors:

Error using mex

C6xSimulator.c
C:\ti\ccsv5\tools\compiler\c6000_7.4.1\include\stdio.h(69) : error C2054: expected '(' to follow
'__SIZE_T_TYPE__'
C:\ti\ccsv5\tools\compiler\c6000_7.4.1\include\stdio.h(79) : error C2085: 'FILE' : not in formal parameter
list
C:\ti\ccsv5\tools\compiler\c6000_7.4.1\include\stdio.h(83) : error C2085: 'fpos_t' : not in formal
parameter list
C:\ti\ccsv5\tools\compiler\c6000_7.4.1\include\stdio.h(151) : error C2085: 'FILE' : not in formal
parameter list

and also we are using Microsoft Visual C++ 2012 as our default compiler.

does anyone have any idea what is going wrong?