How to select compiler if not available on the list provided by mex -setup ??
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
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
Accepted Answer
Walter Roberson
on 21 Jun 2011
0 votes
Is your system 32 bit Windows or 64 bit?
11 Comments
Walter Roberson
on 21 Jun 2011
See http://www.mathworks.com/support/compilers/R2011a/win64.html
Walter Roberson
on 21 Jun 2011
See also, http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/?solution=1-6IJJ3L
Simon
on 21 Jun 2011
Thank you!
I am trying it out.
Simon
on 21 Jun 2011
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.
Walter Roberson
on 21 Jun 2011
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*.*
Simon
on 21 Jun 2011
>> 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...
Walter Roberson
on 21 Jun 2011
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
Simon
on 21 Jun 2011
And yes, i have unzip the entire archive.
Simon
on 22 Jun 2011
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?
Walter Roberson
on 22 Jun 2011
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>
}
Simon
on 22 Jun 2011
yvals.h does not have such line. I have posted a question for Venn, hopefully he will answer me.
Thanks a lot!
More Answers (1)
Simon
on 21 Jun 2011
0 votes
it is a Windows 64bit with Matlab 2010a installed.
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Tags
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)