Unable to create mex function 'XX_Simuli​nkfunction​_sfun.mexw​64' required for simulation.

132 views (last 30 days)
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.

Answers (2)

Jagtendra Kumar
Jagtendra Kumar on 6 Sep 2019
Edited: Jagtendra Kumar on 6 Sep 2019
try this solution :- setting requires in Configuration Parameters > Simulation Target > Adavanced Parameters > Enable Genetared typedefs for imported bus and enumeration type.

Jing Chen
Jing Chen on 20 Aug 2021
Hi
Did you solve your problem?

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!