MATLAB Answers

0

How to package MEX files with linked libraries?

Asked by Bruce Elliott on 20 Jan 2016
Latest activity Commented on by Yuebin Zhou on 22 Jan 2016
I've developed a set of MEX files that I'd like to distribute to coworkers for use on an isolate network. I compiled them on Windows using the C++ compiler in MS Visual Studio 2010, and I've found that the MEX files rely on a number of .dll files that come with the MS VS installation.
Is there a best practice for packaging the .mex files along with any necessary .dll files? I could try to determine all the dependencies manually and then search for the files to copy them, but if the packaging tool can do that for me, that would probably be a better way to do it.

  1 Comment

This should be possible. You can try the procedure below.
1. Open deploytool from MATLAB.
2. Select ' Application Compiler' in order to create an executable.
3. Add the main file for your application. This is the main M-file that needs to be compiled.
4. In the 'Files installed with your application' section, please add the required dll files.
5. Now you can Package the application.
6. When the deployment process is complete a file explorer opens and displays the generated output. It should contain three directories: for_redistribution, for_testing, for_redistribution_files_only
7. Please navigate to the for_redistribution directory. This contains the executable that you can distribute. It will first install the application and place the dll files in the installed application directory. As a result, executing the application will pick up the correct dll files.
Please also note that if any dll file needs to be registered, then you may probably register it manually.

Sign in to comment.

0 Answers