How to create multiple DLL files (.mexw32 files) in one Visual Studio project?

I support the Matlab library, which consists of a huge number of MEX files. So far I have created a library with a Matlab script, but now I would like to start using the Microsoft Visual Studio IDE for the entire build process. I got pretty far with the following instructions:

However, these instructions only work with one MEX file. The problem I am facing is how to create multiple .mexw32 targets (or, equivalently .dll) within a single Visual Studio project? Creating a separate project (within the same solution) for MEX files is not an option that I want to consider. These files are considered hundreds.

For those unfamiliar with Matlab, MEX files are extension files written in C ++ and compiled mainly into .dll files with a special extension .mexw32. Each of them exports a single entry point void mexFunction(...). AFAIK, you cannot link them to a single .dll, which I would rather do.

+3
source share
2 answers

, MATLAB script. , MATLAB :

mex -f msvc90opts.bat MyMexFile.c

. , , MEX. msvc90opts.bat , MATLAB bin\win32\mexopts.

mex , , :

matlab.exe -wait -sd . -nosplash -nojvm -r "BuildMex, exit"
+1

, MEX - . , , . , . , .

, .

0

Source: https://habr.com/ru/post/1786947/


All Articles