.m to .exe

1 次查看(过去 30 天)
muhammad usama
muhammad usama 2011-6-2
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.

采纳的回答

Walter Roberson
Walter Roberson 2011-6-2
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.

更多回答(4 个)

Image Analyst
Image Analyst 2011-6-3
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 个评论
Walter Roberson
Walter Roberson 2011-6-3
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.

请先登录,再进行评论。


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

muhammad usama
muhammad usama 2011-6-7
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 个评论
Walter Roberson
Walter Roberson 2011-6-7
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.

请先登录,再进行评论。


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

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by