Filter löschen
Filter löschen

Matlab C++ Shared dll library initialization crash

3 Ansichten (letzte 30 Tage)
Dominik Brugger
Dominik Brugger am 5 Jun. 2018
I created a shared library for interfacing matlab functionality from a C++ project. My build environment is as follows:
  • Matlab R2018a
  • Visual Studio 2017
  • Windows 10
When initializing the library the application crashes.
I can confirm that using the "-nojvm" option as suggested here: https://de.mathworks.com/matlabcentral/answers/286624-matlab-c-shared-dll-library-initialization-problem avoids the crash.
Yet this is not a viable solution in my case as I have to integrate a library that uses matlab figure handles. Using "-nojvm" therefore leads to a runtime error:
Error using figure
This functionality is no longer supported under the -nojvm startup option. For more information, see "Changes to -nojvm Startup Option" in the MATLAB Release Notes. To view the release note in your system browser, run web('http://www.mathworks.com/help/matlab/release-notes.html#btsurqv-6', '-browser').
I have attached a small example project that reproduces the crash and interfaces a simple function:
function createPlot()
fh = figure;
plot(1:10, 1:10);
saveas(fh, 'test', 'png');
end

Antworten (1)

Anurag Pratap Singh
Anurag Pratap Singh am 24 Jun. 2020
Hi Dominik
I understand that you are trying to create a shared library for interfacing matlab functionality from a C++ project.
I would suggest you to use a different version of visual studio or matlab for this as there might be some mismactch of the versions.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by