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!