problem with building a simulink model with two s-functions written in C language
7 次查看(过去 30 天)
显示 更早的评论
Hi all, I have a problem with building a Simulink model for Real-time aplication. I try to build a mdl with two S-functions written in C. I use same header files in both S-functions. I have biult the C files with "mex MPCtest1.c MPCtest2.c" (these are very simple test S-functions whih I created to try resolving the problem). Here is the message that Matlab produces:
MPCtest2.obj : error LNK2005: __ssSetInputPortMatrixDimensions already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: __ssSetOutputPortMatrixDimensions already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: __ssSetInputPortVectorDimension already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: __ssSetOutputPortVectorDimension already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssIsRunTimeParamTunable already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssGetSFuncBlockHandle already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: __ssGetCurrentInputPortWidth already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: __ssGetCurrentOutputPortWidth already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssWarning already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssGetDTypeIdFromMxArray already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssWriteRTWStr already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssWriteRTWNameValuePair already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssWriteRTWParameters already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssWriteRTWParamSettings already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssWriteRTWWorkVect already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _mexFunction already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssWriteRTWMxVectParam already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _ssWriteRTWMx2dMatParam already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _DYNAMIC_DIMENSION_DEF already defined in MPCtest1.obj
MPCtest2.obj : error LNK2005: _DYNAMIC_DIMENSION already defined in MPCtest1.obj
It would be great if someone could help me.
Thank you!!!
0 个评论
采纳的回答
Kaustubha Govind
2011-9-1
You need to compile them separately - they need to be two separate binaries:
mex MPCtest1.c
mex MPCtest2.c
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Debugging and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!