"Internal problem" when running a MEX file the second time
Mostra commenti meno recenti
Hi, I am having a problem when trying to run a .mexmaci64 file written by C++ with OpenCV the second time. I really appreciate if someone could help me.
Here is the test I did: I created a .dylib by C++ and some OpenCV stuff, and compiled it in the terminal with something like this:
g++ -dynamiclib Test.cpp -fvisibility=hidden -o libTest.dylib `pkg-config --cflags --libs opencv`
Then, in the mexFunction, I loaded this .dylib and did nothing else. It could run properly the first time, but Matlab popped up a window saying "Matlab encountered a internal problem... bla bla" when I ran it the second time.
I think it's because the dylib with OpenCV couldn't be loaded properly the second time, since I tried the same thing without the OpenCV stuff and everything is fine.
Does anyone know how to solve this? Thank you!
Risposte (1)
Ken Atwell
il 18 Giu 2012
0 voti
Does the OpenCV library have a "close" function or something similar to call before the library is unloaded? Assuming there is, you could call this as the last operation in Test.cpp.
1 Commento
Liu
il 18 Giu 2012
Categorie
Scopri di più su OpenCV Support in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!