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
Best Answer