Building portable MEX files
显示 更早的评论
Hi. My question is how to build MEX files that are portable using the Matlab Coder?
The problem: I can build a MEX file, using Visual Studio C++ Express from auto generated (by Matlab Coder) C code that can run on my system with no problems, but when I try to run it on a different system, without Matlab Coder, I cannot run it even after installing the Visual Studio redistributeable files. The error code I get is: "Invalid MEX file: specific module cannot be found".
The by far optimal solution: I have actually looked deeper into this and found, using DependencyWalker, that a number of DLL files are required in order for the MEX file to run. If they are not present in the system path, or working directory, the MEX file cannot run and gives the above error code.
Can anyone comment/aide on this?
Sincerely, Tobias Elmøe
采纳的回答
更多回答(3 个)
Tobias Elmøe
2011-7-12
1 个投票
4 个评论
Friedrich
2011-7-12
Thats a good question and I really don't know it. Please post the answer you got from MathWorks because I think other users could have the same question and looking for an answer
Tobias Elmøe
2011-7-12
Friedrich
2011-7-12
Thanks for posting
Tobias Elmøe
2011-7-29
Alexander Bottema
2011-7-12
0 个投票
Hi Tobias, Do you know what DLLs are missing? When you say that you try to run it on a different system, does this mean that MATLAB is installed (but not MATLAB Coder)? Or do you mean that MATLAB itself is not installed? Thanks, Alexander
Friedrich
2011-7-12
0 个投票
Hi,
please contact MW Technical Support for this. It seems that ML Coder is not made for deplyoing your mex functions to other ML users.
I think the Technical Support can tell you more about this.
(Simply copying the missing DLLs will violate the license agreement)
3 个评论
Tobias Elmøe
2011-7-12
Friedrich
2011-7-12
It really looks like that it is not made for deploying. The MCR provides these DLLs which your mex file is missing. So writing a wrapper function and compiling it into an exe should work fine. But I think there is no easy way to deploy the mex file only.
Contact the Support and mention these two internal numbers: g730952 and g613886 (this should speed things up)
Tobias Elmøe
2011-7-12
类别
在 帮助中心 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!