.m to .exe

6 views (last 30 days)
muhammad usama
muhammad usama on 2 Jun 2011
I am willing to convert *.M file (basically a GUI) in *.EXE file. I am using matlab R2009a, I didn't get any complier in mbuild. I did some work on it, now i have VS2008 and MCR installed in my system. Before proceeding I just came here to as you how to do so? Is there any role of VS2008 o just MCR can do it?
P.S: I am using win7 Home Premium 64 bit.

Accepted Answer

Walter Roberson
Walter Roberson on 2 Jun 2011
The supported compilers are shown here. Please especially note footnote 6, which leads you to this important solution for 64 bit use.
MCR is not a compiler: it is part of the run-time for the executable.

More Answers (4)

Image Analyst
Image Analyst on 3 Jun 2011
You can choose the VS2008 compiler. You just pick it when you do "mbuild -setup"
You need to run mbuild -setup whenever you install a new version of MATLAB or install additional compilers, such as VS2008.
  1 Comment
Walter Roberson
Walter Roberson on 3 Jun 2011
Notice he is using Windows 64: for that you have to go through a two-step installation process in order to get the 64 bit compilers. The description of the process is linked to in my answer.

Sign in to comment.


muhammad usama
muhammad usama on 3 Jun 2011
Thank you for replying I am following your instructions. I'll come back to you if it will be rquired.

muhammad usama
muhammad usama on 7 Jun 2011
i followed those steps, and now i am getting VS08 in mex, what else to do now? I am posting the result of mex -setup which i got. please have a look.
>> mex -setup Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler: [1] Microsoft Visual C++ 2008 Express in C:\Program Files (x86)\Microsoft Visual Studio 9.0
[0] None
Compiler: 1
Please verify your choices:
Compiler: Microsoft Visual C++ 2008 Express Location: C:\Program Files (x86)\Microsoft Visual Studio 9.0
Are these correct [y]/n? y
************************************************************************* Warning: MEX-files generated using Microsoft Visual C++ 2008 require that Microsoft Visual Studio 2008 run-time libraries be available on the computer they are run on. If you plan to redistribute your MEX-files to other MATLAB users, be sure that they have the run-time libraries. *************************************************************************
Trying to update options file: C:\Users\USAMA\AppData\Roaming\MathWorks\MATLAB\R2009a\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2009a\bin\win64\mexopts\msvc90freeopts.bat
Done . . .
************************************************************************ Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/support/solutions/data/1-5C27B9.html?solution=1-5C27B9 Building with the -largeArrayDims option enables the new API.
  1 Comment
Walter Roberson
Walter Roberson on 7 Jun 2011
Okay, those are warnings not errors. You can now proceed to build your mex. Note that you might have problems if the code was written expecting 32 bit windows.

Sign in to comment.


muhammad usama
muhammad usama on 7 Jun 2011
after this I did: mcc -m filename.m and it crearted *.exe file in the default directory.
Thanks alot for you help and guidance.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!