matlab digits函数,编译matlab的s函数(compiling s-functions for matlab)

I have been trying to make an s-function block in matlab with my c++ codes.I am using the following mexopts.bat file

@echo off

set MATLAB=%MATLAB%

set PATH=%PATH%;c:\cygwin\bin

set MW_TARGET_ARCH=win64

set COMPILER=x86_64-w64-mingw32-g++

set COMPFLAGS=-c -fexceptions "-I%MATLAB%\extern\include"

set OPTIMFLAGS=-O3

set DEBUGFLAGS=-g -Wall

set NAME_OBJECT=-o

set PRELINK_CMDS1=echo EXPORTS > mex.def & echo mexFunction >> mex.def

set LIBLOC="%MATLAB%\bin\win64"

set LINKER=x86_64-w64-mingw32-g++

set LINKFLAGS= -static-libgcc -shared mex.def -L%LIBLOC% -static-libstdc++

set LINKFLAGSPOST= -lmex -lmx -lmwlapack -lmwblas -lstdc++

set LINKOPTIMFLAGS=-O3

set LINKDEBUGFLAGS= -g -Wall

set LINK_FILE=

set LINK_LIB=

set NAME_OUTPUT=-o "%OUTDIR%%MEX_NAME%%MEX_EXT%"

set RSP_FILE_INDICATOR=

set POSTLINK_CMDS1=del mex.def

I am able to successfully compile sample mexfunction file from matlab using the 'mex' function,But when i try compiling an s-function(i took the example files with matlab) i get the following errror

C:\Program Files\MATLAB\R2012a\simulink\include/simstruc.h:357:3: error: #error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE

C:\Program Files\MATLAB\R2012a\simulink\include/simstruc.h:467:78: fatal error: rt_matrx.h: No such file or directory

compilation terminated.

I am sure the c++ files are correct ,coz i took them from matlab examples

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值