Create .lib file with matlab compiler

4 views (last 30 days)
Yoni
Yoni on 4 Aug 2011
Hi,
I'm trying to compile a simple function with the matlab compiler (2007b).
the compilation ends with the following lines:
--------------------------------------------------
Copying: D:\...\src\MyLib.lib -> D:\...\distrib
Could not copy file to the output directory.
--------------------------------------------------
The .lib file is only available in the intermediate folder (\src). I'm able to load and call the function from the generated DLL but when I try to link to the .lib I get a runtime error when my application loads.
Any idea how to properly create a .lib?
Thanks,
Yoni

Answers (1)

Kaustubha Govind
Kaustubha Govind on 4 Aug 2011
I don't know that it is possible to create a static library using MATLAB Compiler. The .lib file that you see generated is the import library for the generated DLL - it needs to be used with the DLL. What is the runtime error that you see after linking against the .lib file? Is it about being unable to find the corresponding DLL? In that case, you should simply have to add the DLL to the system path.
(I'm not sure why the error about being unable to copy occurs)

Categories

Find more on C Shared Library Integration 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!