Can't get Matlab compiler and loadlibrary to work
Show older comments
I'm trying to use the Matlab compiler to create a standalone version of a program. I'm running R2012b (32-bit) , with the standard Lcc-win32 provided by Matlab. I have to use 32-bit because I'm deploying for a 32-bit WinXP machine.
I'm getting an error about loadlibrary, which points to this web page, http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/brb8oui.html , but it is missing.
The error message is "Deployed applications must use a prototype file instead of a header file. To create the prototype, use the loadlibrary mfilename option. Use the prototype file in compiled code."
I have been able to compile this previously, with R2012a or maybe an earlier version (can't recall). For some reason it doesn't work now.
My main program myprogram.m is in a folder C:\myprogram\source, from where I compile it. I'm trying to include a library S5_SPI_D2XX_DLL.dll in the subfolder C:\myprogram\classes\@S5_Com. That folder also contains S5_SPI_D2XX_DLL.h and @S5_Com.m.
My compile line is:
mcc -m myprogram.m ...
-o 'myprogram' ...
-d '..\compiled\' ...
-v ...
-N ...
-a '..\classes\' ...
-a '.\S5_SPI_D2XX_DLL.m' ...
-I '..\classes\'
and in my C:\myprogram\classes\@S5_Com\@S5_Com.m file I use the line
loadlibrary('..\classes\@S5_Com\S5_SPI_D2XX_DLL', 'S5_SPI_D2XX_DLL.h', 'alias', h.libID, 'mfilename', 'S5_SPI_D2XX_DLL.m');
Before compiling, I have run myprogram uncompiled from the Matlab CLI to generate the S5_SPI_D2XX_DLL.m file in the source folder. Still, I can't get this to work.
I have even tried to run the compiled myprogram.exe from the source folder, or copy the S5_SPI_D2XX_DLL.m file to the \compiled\ folder, but to no effect.
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!