Why do I receive an error when I call my MATLAB Compiler 4.0 (R14) generated shared library from another shared library?

2 views (last 30 days)
There is a problem when a MATLAB shared library (as generated by the MATLAB Compiler) is loaded by another shared library. The MATLAB library initialization function (e.g., <lib-name>Initialize) can not be called from the intermediate shared library during the DllMain(DLL_ATTACH_PROCESS) call. This applies whether the intermediate shared library is implicitly or explicity loaded.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
We have verified that documentation on the MATLAB Compiler-generated shared libraries is inadequate on this topic in the MATLAB 7.0 (R14) manual.
The problem is with the placement of the call to <lib-name>Initialize(). Placing the call during DllMain(DLL_ATTACH_PROCESS) [or CWinApp::OnInitInstance()] causes the application to hang. To avoid the problem, place the call somewhere after DllMain().

More Answers (0)

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!