Creating a Stand Alone App for a Matlab GUI

2 次查看(过去 30 天)
I would like to be able to create .dll, .h, and .lib files that I can use and call from MS Visual C++ 6.0. At this point I have made a Matlab GUI which uses several .m and .fig files. I have also used the Matlab compiler and the command:
mcc –B cpplib:new_file_name file1.m file1.fig file2.m
to create a C++ shared library that has .dll, .h, and .lib files and I have successfully called "file 1" from MS Visual C++ in a Win 32 Console Application. However, when I call "file 1" in the C++ program, there is a long delay before my MATLAB GUI opens. I believe this is because during this time, the MATLAB license had to be accessed. Therefore, I need a different way of compiling my Matlab code into a .dll, .h, and .lib format that can be used in another program without ever having to use the MATLAB license. Another option for me is if there is some sort of way (using visual C++ or MATLAB) to see if the MATLAB license is actually being used when I run my C++ program that calls the MATLAB GUI. (If my gui is in fact being run without the MATLAB license then I don't have a problem and the long delay is being caused by some other reason.) Thanks for any help.

采纳的回答

Walter Roberson
Walter Roberson 2013-11-6
No, executables built with the MATLAB Compiler do not need the license to be checked (at least not for the base product.)
However, when you build something with the MATLAB Compiler, the time to start it up will be almost exactly the same as it would take to start up MATLAB itself. MATLAB Compiler uses the same threaded interpretion mechanism that MATLAB itself uses.
If you need something that loads faster, then you need to use MATLAB Coder. However, MATLAB Coder is not able to generate code for any graphic elements.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 C Shared Library Integration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by