What toolboxes does mcc support? Failed to load C++ shared Library

6 visualizaciones (últimos 30 días)
Fiavi Yang
Fiavi Yang el 12 de Jul. de 2022
Editada: Fiavi Yang el 12 de Jul. de 2022
Hi. I have a simple MATLAB function that uses Signal Processing Toolbox. I want to generate C++ shared libraries of this function so I used mcc,
mcc -W 'cpplib:<name of the dll>,all' -T link:lib <my function>.m
and I got a .dll, a .lib, and a .h file. However, I could not initialize and use the generated library.
Here's what I did in my c++ program to load the library. It triggers the error "Could not initialize the library properly".
#include "<Generated header file>.h"
if (!mclInitializeApplication(NULL, 0)) {
std::cerr << "Could not initialize the application properly" << std::endl;
std::cin.get();
return -1;
}
if (!<my function>Initialize()) {
std::cerr << "Could not initialize the library properly" << std::endl;
std::cin.get();
return -1;
}
//Code...
<my function>Terminate();
if (!mclTerminateApplication()) {
std::cerr << "Unexpected error during termination" <<
std::endl;
std::cin.get();
return -1;
}
This is not the first time I used mcc and integrated shared libraries in to c++ program, but this is the first time I do it with a function that uses a toolbox, and it doesn't work. So I wonder if this method supports toolboxes? Any suggestions?

Respuestas (0)

Categorías

Más información sobre C Shared Library Integration en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by