mex -setp "Unable to complete successfully"

1 Ansicht (letzte 30 Tage)
Juan
Juan am 16 Apr. 2014
Beantwortet: Harsheel am 17 Apr. 2014
I am trying to to use mex but I cannot make it work.
I have Matlab 2013a installed in a Ubuntu 12.04 (64 bit). I also have gcc 4.6.3 insatalled.
No matter what I try wiht mex, but I always get the same error with no information:
>> mex
Error using mex (line 206)
Unable to complete successfully.
>> mex -setup
Error using mex (line 206)
Unable to complete successfully.
>> mex test_function.cxx
Error using mex (line 206)
Unable to complete successfully.
Any ideas?
  3 Kommentare
Ken Atwell
Ken Atwell am 17 Apr. 2014
Can you invoke gcc directly from MATLAB:
>> !gcc
Juan
Juan am 17 Apr. 2014
>>!gcc does nothign

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 17 Apr. 2014
When you type ver on the command line, do you see the compiler listed?
  3 Kommentare
Image Analyst
Image Analyst am 17 Apr. 2014
Well then you need to purchase the MATLAB Compiler Toolbox.
Juan
Juan am 17 Apr. 2014
Bearbeitet: Juan am 17 Apr. 2014
that makes sense hehe.
I didn't know it was a separate toolbox.
Thanks
EDITED
Nope, that didn't work. However do I need the compiler library to use mex (I don't want to compile an .m file)?
I have even reinstalled but it still won't work. For now I will just compile the cxx function somewhere else

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Harsheel
Harsheel am 17 Apr. 2014
No, you do not need MATLAB Compiler product to use the MEX function. If ">>mex -setup" is erroring out exactly the way you've mentioned above then that means your GCC may be wrongly installed on the system.
By the way, you need gcc 4.4.x, as gcc 4.6.3 is unsupported with R2013a. So first, install the correct version and make sure it's installed correctly by executing ">>!gcc --version" from inside MATLAB. If it shows the correct version then, try executing ">>mex -setup".

Kategorien

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

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by