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 ExchangeWrite 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