How to select compiler if not available on the list provided by mex -setup ??

Hi, i have just downloaded the matlab toolbox:
The mex function is asking me for a compiler. Microsoft Visual C++ express 2010 is already installed. I have followed the instructions of the Mex-setup function which is unable to locate this compiler. How can i compile the few .cpp file i need? Or how can find my compiler? Thanks

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 21 Jun. 2011
Is your system 32 bit Windows or 64 bit?

11 Kommentare

See http://www.mathworks.com/support/compilers/R2011a/win64.html
See also, http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/?solution=1-6IJJ3L
Thank you!
I am trying it out.
Sorry but i have been through all the steps indicated and I still end up with an error when compiling. All files are in the same folder. Here is the command i put in Matlab:
mex BuildGLTree3DFEX.cpp
C:\PROGRA~1\MATLAB\R2010A\BIN\MEX.PL: Error: 'BuildGLTree3DFEX.cpp' not found.
??? Error using ==> mex at 222 Unable to complete successfully.
To cross-check: the URL you posted first was for a single .m file only. Did you download and unzip the entire archive? In MATLAB, what do you see if you ask
ls BuildGLTree3DFEX.cpp
and
ls B*.*
>> ls BuildGLTree3DFEX.cpp
BuildGLTree3DFEX.cpp not found.
>> ls b**
boot.ini
Well, i don't understand something. do the .cpp files need to be in the bin folder of Matlab?, i have also tried to extract them somewhere else, and i have:
ls BuildGLTree3DFEX.cpp
BuildGLTree3DFEX.cpp
>> mex BuildGLTree3DFEX.cpp
BuildGLTree3DFEX.cpp
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\yvals.h(576) : error C2371: 'char16_t' : redefinition; different basic types
c:\program files\matlab\r2010a\extern\include\matrix.h(330) : see declaration of 'char16_t'
f:\phd\research\snownet data\glenncreek\scan shift\GLTree3DFEX.cpp(119) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
f:\phd\research\snownet data\glenncreek\scan shift\GLTree3DFEX.cpp(120) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
f:\phd\research\snownet data\glenncreek\scan shift\GLTree3DFEX.cpp(121) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
f:\phd\research\snownet data\glenncreek\scan shift\GLTree3DFEX.cpp(141) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
f:\phd\research\snownet data\glenncreek\scan shift\GLTree3DFEX.cpp(142) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
f:\phd\research\snownet data\glenncreek\scan shift\GLTree3DFEX.cpp(143) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
f:\phd\research\snownet data\glenncreek\scan shift\GLTree3DFEX.cpp(235) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
f:\phd\research\snownet data\glenncreek\scan shift\GLTree3DFEX.cpp(255) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
f:\phd\research\snownet data\glenncreek\scan shift\GLTree3DFEX.cpp(276) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
BuildGLTree3DFEX.cpp(29) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
BuildGLTree3DFEX.cpp(35) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
C:\PROGRA~1\MATLAB\R2010A\BIN\MEX.PL: Error: Compile of 'BuildGLTree3DFEX.cpp' failed.
??? Error using ==> mex at 222
Unable to complete successfully.
Looks a little bit better...
The files do not need to be in the bin folder (and being there is a bad idea), but you _do_ have to be cd()'d to the directory they are in.
For the other matter, see the solutions here:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/281754
And yes, i have unzip the entire archive.
Sorry, but i am not very familiar yet with programming out of Matlab. So there are few explanation on the page you just gave, but very unclear to me.
Neither in the file yvals.h nor matrix.h there is a command line
namespace mat
If i follow instruction given by Fifo, the line number he gave seems irrelevant to me for the file matrix.h. Which solution should i follow?
I would suggest doing it the way Venn suggests. Go in to yvals.h and find the line that has
#include <matrix.h>
and change it to
namespace mat {
#include <matrix.h>
}
yvals.h does not have such line. I have posted a question for Venn, hopefully he will answer me.
Thanks a lot!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Simon
Simon am 21 Jun. 2011
it is a Windows 64bit with Matlab 2010a installed.

Kategorien

Mehr zu MATLAB Compiler finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by