MATLAB: How to specify version information for a DLL compiled using MATLAB Compiler when set up with LCC

appdllslibMATLAB Compilermbuild

I would like to include version information with my DLL. I am compiling the DLL in MATLAB using the MCC command and the LCC Compiler.

Best Answer

Version information can be added to MATLAB Compiler DLLs by using a resource script (.rc) file with the LCC Resource Compiler.
In order to invoke the LCC Resource Compiler, the compiler options file for LCC (lcccompp.bat) must be modified by setting the resource compiler parameter RC_COMPILER as follows:
1. Copy the options file for LCC (lcccompp.bat) located in <matlabroot>\bin\win32\mbuildopts into your working directory. It is recommended that a copy of this file be created in your working directory and renamed such that it does not conflict with the shipped options file. Note that, here <matlabroot> is the name of the directory where the MATLAB software is installed.
2. Edit this file to set the RC_COMPILER parameter as follows:
set RC_COMPILER=lrc -I"%MATLAB%\sys\lcc\include" -noregistrylookup -fo"%OUTDIR%%RES_NAME%.res"
3.Save this file as lcccompp_modified.bat and use this file along with the .rc file at compilation, as follows:
mcc -l myproject.m myproject.rc -f lcccompp_modified.bat
Note: The inclusion of resource files when compiling COM objects in MATLAB is not currently supported.