Unable to create mex function 'XX_Simulinkfunction_sfun.mexw64' required for simulation.
조회 수: 19 (최근 30일)
이전 댓글 표시
I am trying to call custom c code in my stateflow and got below error
Making simulation target "XX_Simulinkfunction_sfun", ... Microsoft (R) Program Maintenance Utility Version 14.10.25019.0 Copyright (C) Microsoft Corporation. All rights reserved. NMAKE : fatal error U1065: invalid option '-' Stop.
Component:Make | Category:Make error
Unable to create mex function 'XX_Simulinkfunction_sfun.mexw64' required for simulation.
example.c
#include "example.h"
double busactive(double u1, double u2)
{
double retval;
retval = u1 + u2;
return (retval);
}
example.h
#define TRUE 1
#define FALSE 0
#define MAYBE 2
double busactive(double, double);
added #include "example.h" in simulation target Header file section and example.c is source file section.
using 2018a matlab and MEX configured to use 'Microsoft Visual C++ 2017 (C)' for C language compilation.
Could anyone help me solving this issue.
댓글 수: 2
MIN U SHIN
2020년 12월 28일
no, I'm stucked in same problem.
Unable to create mex function 'AutomatedParkingValet_sfun.mexw64' required for simulation.
How can I solve this?
답변 (3개)
Jagtendra Kumar
2019년 9월 6일
편집: Jagtendra Kumar
2019년 9월 6일
try this solution :- setting requires in Configuration Parameters > Simulation Target > Adavanced Parameters > Enable Genetared typedefs for imported bus and enumeration type.
댓글 수: 2
weyl chen
2024년 8월 19일
It's trouble for me. But I find this cause. "Unable to create mex function 'VLC_APA_sfun.mexw64' required for simulation."
I am find last. because The Enum Data type is error. I define the enum name is "Astate" 0-state1 1-state2 2-state3.
in chart if you defin the same name of inport and enum, this may error of "Unable to create mex function 'VLC_APA_sfun.mexw64' required for simulation."
e.g.
if (Astate == Astate.state1) {aa = 0;}
change this
if (Astate_in == Astate.state1) {aa = 0;} the problem is gone.
=================================================================================
问题:
“由于枚举数据类型错误,导致无法为仿真创建所需的 'VLC_APA_sfun.mexw64' MEX 函数。”
解决方案:
“我在状态图中定义了一个名为 'Astate' 的枚举类型,其值为 0-state1,1-state2,2-state3。如果在状态图中定义的枚举名称与输入端口名称相同,就可能出现 'VLC_APA_sfun.mexw64' MEX 函数创建失败的错误。例如,如果写成:
```c
if (Astate == Astate.state1) { aa = 0; }
```
会出现问题。但改成:
```c
if (Astate_in == Astate.state1) { aa = 0; }
```
问题就解决了。”
您需要确保在条件语句中使用的枚举变量名与输入端口的名称区分开来,避免命名冲突。
댓글 수: 1
참고 항목
카테고리
Help Center 및 File Exchange에서 Transportation Engineering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!