Why MATLAB Coder can't build MEX?

3 ビュー (過去 30 日間)
dm b
dm b 2017 年 12 月 8 日
編集済み: Ryan Livingston 2018 年 3 月 2 日
I have a problem. MATLAB Coder doesn't work properly with one of my projects. At Check For Issues state it generates error "MEX build failed". But it doesn't generate any error. Target Build Log is empty. When I try to do the same on the another PC with the same settings, there is no errors and MEX building is successfull. On the first PC MATLAB R2017a is installed, on the second PC MATLAB R2016b is installed. Why MEX building fails on the first PC and how can I define what error was occured?
  5 件のコメント
dm b
dm b 2018 年 2 月 28 日
Deleting mex and any other generated files has no effect.
Ryan Livingston
Ryan Livingston 2018 年 3 月 2 日
編集済み: Ryan Livingston 2018 年 3 月 2 日
I second Denis's advice to contact technical support as at least some sort of diagnostic should be given. Some thoughts beyond that:
  • Are you able to generate a simple MEX file without Coder by following the "Build C MEX File" steps in the MEX documentation? If that errors out try mex -v yprime.c to get verbose messages.
  • Are you able to call codegen on a trivial MATLAB function:
function y = timestwo(x)
y = 2*x;
>> codegen timestwo -args 1
>> timestwo_mex(10)
  • You can also try to get insight into any errors that may be occurring by running:
>> dbstop if all error
in MATLAB and then re-running the "check for issues" step again. That will stop in the MATLAB debugger at all errors thrown regardless of whether or not they are caught. If you keep pressing continue in the MATLAB debugger you may eventually encounter an error that gives you a hint as to what is wrong. Note that you'll likely see many innocuous errors using this technique. Every MATLAB exception that is thrown will cause MATLAB to stop in the debugger, even if that exception is caught and handled. So it may take a bit of time to pinpoint the meaningful issue, if one even exists.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by