How do I compile a standalone executable using MATLAB Compiler 4.16 (R2011b) that has version and file information?

6 views (last 30 days)
I would like to use MATLAB Compiler 4.16 (R2011b) to generate a standalone executable that has version and file information (which can be seen by right clicking on the executable and examining its properties).

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Sep 2015
The ability to directly add version and file information into a standalone executable is not available in MATLAB Compiler 4.16 (R2011b).
As a workaround, consider compiling a C/C++ shared library, and then wrap it in a driver code to create an executable with versioning info. A C++ demo is included in the attachment.
A walkthrough of how the demo was created is below (file names are specific to the demo):
1. Generate the versionRC.rc file and resource.h file using a supported version of Microsoft Visual Studio. (If you are using Microsoft Visual Studio 2010, you can also use the files already provided and just manually edit the .rc file with a text editor as needed. For newer Visual Studio versions follow the instructions in the word document for creating a new resource file).
Details on its generation is included in the CreateResourceFile.doc word file. resource.h is the header file used by versionRC.rc, needed during the MBUILD command.
2. Compile the shared library using the command:
 
>> mcc -v -W cpplib:libadd -T link:lib addone.m
3. Write the addprogram.cpp code. (Unfortunately, this code has to interface with the shared library, so it has to be rewritten or updated for different compiled functions.)
4. Compile the final executable using the command:
 
>> mbuild addprogram.cpp libadd.lib versionRC.rc

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products


Release

R2011b

Community Treasure Hunt

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

Start Hunting!