Why does my MATLAB-compiled library (DLL) fail to initialize after creating a deployment package in Visual Studio?
8 views (last 30 days)
Show older comments
MathWorks Support Team
on 20 Jun 2011
Edited: MathWorks Support Team
on 21 Feb 2017
I have created a DLL with the MATLAB compiler, and I am able to use it successfully in the context of a larger application I have created in Visual Studio. Since I want to deploy this application to another computer, I used Visual Studio to create a deployment package for installation on the deployment machine. After installing the deployment package, I observe the following error when executing my application:
System.ArgumentException: Generate Queries threw General Exception:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at mclGetString_proxy(Void**, SByte*)
at mwArray.{ctor}(mwArray*, SByte* str)
at ISRWrapper.Wrapper.CsvsStats(String inFolder, String outFolder)
at ISRWrapper.Wrapper.CsvsStats(String inFolder, String outFolder)
at Presentation.Forms.QueryGenOptionsForm.btnGenQry_Click(Object sender, EventArgs e)
Accepted Answer
MathWorks Support Team
on 21 Feb 2017
This change has been incorporated into the documentation in Release 2011a (R2011a). For previous releases, read below for any additional information:
This error is often caused by the presence of mclmcrrt7x.dll outside of the "mcr_root" directory, where "mcr_root" is the path to the installation directory of MATLAB Compiler. Sometimes this library gets placed in the installation directory of the deployment package, either by the developer or as the result of dependency calculations during the creation of the package. To work around this issue, inspect the installation directory and remove any instances of this or any other MCR libraries that you find.
0 Comments
More Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!