Error using mex on c file

1 view (last 30 days)
pkenned Kennedy
pkenned Kennedy on 18 Apr 2013
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 Comment
Kaustubha Govind
Kaustubha Govind on 19 Apr 2013
What do you have on line#49? Everything else is warnings that you can fix with explicit casts.

Sign in to comment.

Answers (0)

Categories

Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!