What toolboxes does mcc support? Failed to load C++ shared Library
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!