"Internal problem" when running a MEX file the second time
이전 댓글 표시
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!
답변 (1개)
Ken Atwell
2012년 6월 18일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 OpenCV Support에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!