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

1 Ansicht (letzte 30 Tage)
dave
dave am 30 Okt. 2012
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 Kommentare
Jan
Jan am 30 Okt. 2012
What did the author of this tool reply to your email?
dave
dave am 30 Okt. 2012
Unfortunately he hasn't replied yet..

Melden Sie sich an, um zu kommentieren.

Antworten (3)

Jan
Jan am 30 Okt. 2012
Bearbeitet: Jan am 30 Okt. 2012
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 Kommentare
dave
dave am 1 Nov. 2012
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 am 12 Nov. 2012
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.

Melden Sie sich an, um zu kommentieren.


dave
dave am 31 Okt. 2012
Bearbeitet: dave am 31 Okt. 2012
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 Kommentare
Jan
Jan am 31 Okt. 2012
You have successfully installed OpenWatcom under R2011b?! How did you do this?
dave
dave am 1 Nov. 2012
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.

Melden Sie sich an, um zu kommentieren.


dave
dave am 6 Nov. 2012
Jan, do you get the same errors/problems when running Mexme?
  1 Kommentar
Jan
Jan am 12 Nov. 2012
Yes. Errors, problems and solutions. See my comment above.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by