"Internal problem" when running a MEX file the second time
Ältere Kommentare anzeigen
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!
Antworten (1)
Ken Atwell
am 18 Jun. 2012
0 Stimmen
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 Kommentar
Liu
am 18 Jun. 2012
Kategorien
Mehr zu OpenCV Support finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!