What toolboxes does mcc support? Failed to load C++ shared Library
6 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!