How can I include a version resource file in a MEX function on Windows?

5 Ansichten (letzte 30 Tage)
I am using MATLAB on Windows and am creating a MEX-file. Since a MEX-file is a shared library, I would like to be able to include version information in the MEX-file in the same way that I do with other DLLs, that is using a resource file.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 2 Nov. 2020
Bearbeitet: MathWorks Support Team am 2 Nov. 2020
It is possible to add a version resource to a MEX-file. Below are the general steps.
1) Create a compiled version resource file (.res). This can be done using Microsoft Visual Studio's resource compiler (RC) which will compile a resource script (.rc). One easy way to do this is to create a version resource file in a dummy win32 shared library project.
If you need help creating a compiled version resource please refer to the Microsoft Visual Studio documentation at
2) Compile the MEX file and include the resource file created in step 1. For example, if you have a compiled resource file version.res the following command will link it to the MEX-file.
mex yprime.c version.res
Note that you need to use the compiled resource file in order to link it to a MEX-file.

Weitere Antworten (0)

Kategorien

Mehr zu Write C Functions Callable from MATLAB (MEX Files) finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by