Matlab crashes when calling dll
이전 댓글 표시
We have created a dll for an application if we try to call that dll(run loader.m file)suddenly matlab crashes..Need suggestion in this regard
댓글 수: 2
Kaustubha Govind
2013년 5월 31일
You probably also want to clarify that you are calling into a DLL generated by Simulink Coder, and paste the prototypes of the exports from the library from the header file.
vinothkannan K
2013년 6월 5일
편집: vinothkannan K
2013년 6월 5일
답변 (1개)
Craig Cowled
2013년 5월 31일
0 개 추천
Try using 'loadlibrary'.
댓글 수: 12
vinothkannan K
2013년 5월 31일
Friedrich
2013년 6월 5일
Which lines raises the crash? Does your DLL work in a plain C/C++ application? The functionsignature of the functions you call seem pretty simple so I would guess its a BUG in the DLL.
vinothkannan K
2013년 6월 5일
Friedrich
2013년 6월 5일
Write some C code and test it outside of ML. I guess it crashes there too.
vinothkannan K
2013년 6월 5일
Friedrich
2013년 6월 5일
I would need to see the actual code. For now its to vague to tell anything.
vinothkannan K
2013년 6월 5일
Friedrich
2013년 6월 5일
Is i in valid range? Is the ThreadHandle still valid?
vinothkannan K
2013년 6월 5일
One would assume that the generated code behaves like the model, however it could be a bug in the code generation or maybe a design problem of your model which works in MATLAB/Simulink becauses MATLAB takes care of out of bounds accesses whereas C doesnt.
If everything is valid, then it wouldn't crash.
Compile that DLL in debug mode and attach a Debugger to it at runtime to step thorugh the code and to be able to inspect the values at runtime.
vinothkannan K
2013년 6월 5일
vinothkannan K
2013년 6월 6일
편집: vinothkannan K
2013년 6월 6일
카테고리
도움말 센터 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!