Why do I get these error messages when using "MexMe"?

조회 수: 5 (최근 30일)
dave
dave 2012년 10월 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
Jan
Jan 2012년 10월 30일
What did the author of this tool reply to your email?
dave
dave 2012년 10월 30일
Unfortunately he hasn't replied yet..

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

답변 (3개)

Jan
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
dave
dave 2012년 11월 1일
In the file mydouble.c there's no line break between the words "return" and "values". I'm sorry that I'm causing so much trouble with this problem, but that's (at least partially) due to the fact that I'm still pretty new to Matlab and its components.
Anyway...thank you very much for taking a look at it, Jan ;)
Jan
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.

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


dave
dave 2012년 10월 31일
편집: dave 2012년 10월 31일
I spent a couple of hours today searching through C/C++ forums for the solution to the error message I get in line 33 - without any real success. Additionally I installed open watcom c/c++ compiler, to see if mexing the file works with this one - it doesn't.
Couldn't it be that working with MexMe just doesn't work for me because I use Windows??
In MexMes's "comments and rating" section there is actually a quote of another MexMe user saying something about using MexMe on Windows:
"Awesome! Worked as expected for me in my usual Linux environment. Tried to share with a coworker on Windows who couldn't get the c file mexed. I am not as familiar with the Visual Studio compiler, so I haven't been able to figure it out (we have both successfully mexed files in the past)."
  댓글 수: 2
Jan
Jan 2012년 10월 31일
You have successfully installed OpenWatcom under R2011b?! How did you do this?
dave
dave 2012년 11월 1일
There was nothing special about the installation - I just downloaded the file open-watcom-c-win32-1.9.exe from here, installed it, ran mex -setup in Matlab and selected the Open WATCOM C++ compiler.

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


dave
dave 2012년 11월 6일
Jan, do you get the same errors/problems when running Mexme?
  댓글 수: 1
Jan
Jan 2012년 11월 12일
Yes. Errors, problems and solutions. See my comment above.

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

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by