我是 MATLAB 的新手。我正在尝试使用 matlab 帮助中的 S-Function 示例构建我的模型。这是 sfun_counter_cpp.cpp。源代码位于“matlabroot/simulink/src/sfun_counter_cpp.cpp”或http://www-rohan.sdsu.edu/doc/matlab/toolbox/simulink/sfg/sfun_c++2.html中。
首先,我使用“mex”命令构建 C++ S-function,如下所述:http: //www.mathworks.de/de/help/simulink/sfg/building-cs-functions.html。构建成功并创建了 sfun_counter_cpp.mexw32。之后,我创建了一个 S-Function 块,该块提供从我的框图访问 sfun_counter_cpp,单击“增量构建”并收到错误消息“OPUS MAKE:不知道如何制作'sfun_counter_cpp.cppm50'。停止。”
*** Found User-Code File TestModell_usr.c from 05-Jul-2013 15:38:59
*** Found User Makefile TestModell_usr.mk from 05-Jul-2013 15:38:59
*** Optional User Variable Description File TestModell_usr.trc not available
.
### Processing Template Makefile: C:\dSPACE\matlab\rti1005\m\rti1005.tmf
### TestModell.mk which is generated from C:\dSPACE\matlab\rti1005\m\rti1005.tmf is up to date
### Building TestModell: dsmake -f TestModell.mk GENERATE_REPORT=0 EXTMODE_STATIC_ALLOC=0 TMW_EXTMODE_TESTING=0 EXTMODE_STATIC_ALLOC_SIZE=1000000 EXTMODE_TRANSPORT=0
BUILDING APPLICATION "TestModell" (Multiple Timer Task Mode)
WORK DIRECTORY "c:\MyTest"
BUILD DIRECTORY "c:\MyTest\TestModell_rti1005"
TARGET COMPILER "C:\PPCTools37"
COMPILING "TestModell.c"
COMPILING "TestModell_data.c"
COMPILING "TestModell_trc_ptr.c"
COMPILING "rtGetInf.c"
COMPILING "rtGetNaN.c"
COMPILING "C:\PROGRA~2\MATLAB~1\rtw\c\src\rt_matrx.c"
COMPILING "rt_nonfinite.c"
COMPILING "C:\dSPACE\MATLAB\RTI1005\C\rt_printf.c"
COMPILING "C:\dSPACE\MATLAB\RTI1005\C\rti_sim_engine.c"
OPUS MAKE: Don't know how to make 'sfun_counter_cpp.cppm50'. Stop.
----------------------------------------------------------------------
*** Errors occurred during make process.
*** Inspect MATLAB Command Window for details.
*** Aborting RTI build procedure for model TestModell.
----------------------------------------------------------------------
*** Stopped RTI build procedure for model: TestModell.
----------------------------------------------------------------------