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

조회 수: 2 (최근 30일)
Fiavi Yang
Fiavi Yang 2022년 7월 12일
편집: Fiavi Yang 2022년 7월 12일
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?

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by