Error using mex on c file

Hi there,
I am having difficulty using the mex command on a file and I was hoping I could get some advice from you learned individuals. Whenever I use the command
mex ffmygrid.c
I get the following errors:
ffmygrid.c
ffmygrid.c(49) : error C2059: syntax error : 'type'
ffmygrid.c(70) : warning C4305: 'initializing' : truncation from 'double' to 'float'
ffmygrid.c(86) : warning C4554: '|' : check operator precedence for possible error; use parentheses to clarify precedence
ffmygrid.c(88) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(98) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(98) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(99) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(99) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(100) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(100) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(101) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(101) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(102) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(102) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ffmygrid.c(116) : warning C4554: '&' : check operator precedence for possible error; use parentheses to clarify precedence
ffmygrid.c(167) : warning C4554: '|' : check operator precedence for possible error; use parentheses to clarify precedence
C:\PROGRA~1\MATLAB\R2012A\BIN\MEX.PL: Error: Compile of 'ffmygrid.c' failed.
Error using mex (line 206)
Unable to complete successfully.
Could anyone kindly set me on the path to correct this?
I have Windows SDK 7.1 installed and am running Windows 8. I am able to mex the MATLAB sample file timestwo.c so it's not a problem there...
Any help would be greatly appreciated.
Thank you,
Paul

댓글 수: 1

Kaustubha Govind
Kaustubha Govind 2013년 4월 19일
What do you have on line#49? Everything else is warnings that you can fix with explicit casts.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

질문:

2013년 4월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by