Why do I get these error messages when using "MexMe"?
1 次查看(过去 30 天)
显示 更早的评论
I'd like to use MexMe to create mex-files automatically. But each time I run TestMexMe.m, it gives me a host of error messages (20-30) concerning the file mydouble.c.
These are a few of the error messages I get using the Lcc compiler:
>> TestMexMe
Error mydouble.c: 33 illegal statement termination
Error mydouble.c: 33 skipping `const'
Error mydouble.c: 33 illegal use of type name `mxArray'
Error mydouble.c: 33 undeclared identifier `x_ptr'
Error mydouble.c: 33 operands of * have illegal types `incomplete struct mxArray_tag defined at C:\PROGRA~1\MATLAB\R2011B\extern\include\matrix.h 299' and `int'
...etc...
C:\PROGRA~1\MATLAB\R2011B\BIN\MEX.PL: Error: Compile of 'mydouble.c' failed.
Error using mex (line 206)
Unable to complete successfully.
Error in TestMexMe (line 25)
mex mydouble.c
Using MS Visual C++ compiler I get similar errors (all of them have to do with mmydouble.c).
Any idea what might be causing these issues?
ps.: I'm using the R 2011 b version on WinXP.
2 个评论
回答(3 个)
Jan
2012-10-30
编辑:Jan
2012-10-30
These are obvioulsy errors in the mydouble.c program and not caused by MexMe. When you post teh source of this function, we could find the problem. What do you find in line 33?
14 个评论
Jan
2012-11-12
See my comments at FEX: MexMe. The automatically created code has C++ style, but the Windows compiler assumes C according to the file extension. Either rename the file to .cpp (e.g. by modifying MexMe.m), or resort the lines such that the declarations of variables are move before the first line of calculations.
I do not think that MexMe can create Mex-files "in no time" as advertised, but it is much faster than even a very experienced C-Mex-programmer. It must be expected, that automatically generated code demands for a manual fine tuning.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!