Effacer les filtres
Effacer les filtres

Matlab C++ Shared dll library initialization crash

2 vues (au cours des 30 derniers jours)
Dominik Brugger
Dominik Brugger le 5 Juin 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

Réponses (1)

Anurag Pratap Singh
Anurag Pratap Singh le 24 Juin 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.

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by