Using mcc to compile a code that uses a .dll library
Ältere Kommentare anzeigen
Hi,
I created a program in matlab with a GUI. I want to compile it to have an EXE. In the code, I use an external library, but I only have the files: foo.dll foo.h foo.lib.
In the matlab code I call: loadlibrary ('\foo', '\foo.h');
Later, I call some functions of those libraries, using: calllib('foo', 'Function', param);
I compile it using: mcc -m mycode.m -c
The compiler returns no errors, and a "mycode.exe" file is created. However, when I execute I get:
Error using loadlibrary (line 239) 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. See http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/brb8oui.html for more information.
Error in mycode>mycode_OpeningFcn (line 66)
Error in gui_mainfcn (line 221)
Error in mycode (line 42)
Do you have any tip on how I can overcome this?
Thank you.
Akzeptierte Antwort
Weitere Antworten (2)
Nuno Almeida
am 13 Mär. 2012
0 Stimmen
Nuno Almeida
am 13 Mär. 2012
0 Stimmen
2 Kommentare
Kaustubha Govind
am 13 Mär. 2012
You need to manually add the file ADCacquire.m to the CTF archive of the compiled application. You can do this with the -a option (if using the mcc command) or drag it under "Other/Additional Files" if using deploytool. Normally, the MATLAB Compiler analyzes your code and automatically locates all the MATLAB files called from your code, but your call to mexCallMATLAB is probably opaque to MATLAB Compiler.
Nuno Almeida
am 13 Mär. 2012
Kategorien
Mehr zu Standalone Applications finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!