Can a Matlab program that calls a DLL be built into an executable file?

4 ビュー (過去 30 日間)
Canoe Commuter
Canoe Commuter 2014 年 1 月 27 日
コメント済み: Image Analyst 2014 年 1 月 28 日
I have a Matlab program that calls a DLL. It works fine, using loadlibrary and calllibrary. The DLL is from another source, and I have no control over it. It includes a header file, of course.
I have tried to build a distributable version of my program, using Deploytool, but have experienced several failures. However, I am able to successfully create an executable package if I DON'T call the DLL, so I assume the DLL is the problem.
I have a hunch that this has to do with the header file. I removed the header file, and was able to "Build" successfully. However, when I "Package" this build, it fails.
The "Build" failure reports "An error occurred while shelling out to mbuild (error code = 2). Unable to build executable."
The "Package" failure reports "zip I/O error: Permission denied. zip error: Could not create output file (C:/Users…etc.)"
Does anyone know whether there are limitation to deploytool regarding calling DLLs, or what could be going wrong here?
Thanks!!!

採用された回答

Walter Roberson
Walter Roberson 2014 年 1 月 27 日
  2 件のコメント
Canoe Commuter
Canoe Commuter 2014 年 1 月 27 日
Wow. Like magic, it now works. Thank you, Walter! I created a prototype file, following some instructions that I found here: http://www.mathworks.com/matlabcentral/answers/96578 This is a .m file that takes the place of the header (.h) file when building the executable.
I still have the trouble with packaging, but I think this has a separate cause, and although it claims to have failed, it produces a working executable package.
Image Analyst
Image Analyst 2014 年 1 月 28 日
Try the FAQ http://matlab.wikia.com/wiki/FAQ#My_standalone_executable_won.27t_run_on_the_target_computer._What_can_I_try.3F to resolve the remaining issues, especially Dependency Walker and Process Explorer. Or call the Mathworks if you still can't figure it out.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by