The Simulink model contains a block 'Blk1' generated using the S-function target. 'Blk1' was generated from a Subsystem 'subsys1' via the S-function target. subsys1 contains a user written S-function block. (cnt.c). I get the following error when I try to build the model:
### Linking ... D:\MATLAB6p1\sys\perl\win32\bin\perlD:\MATLAB6p1\rtw\c\tools\mkvc_lnk.pl trial1_sfun.lnk trial1_sfun.objrt_sim.obj rt_nonfinite.obj xpctarget.obj trial10_sf.obj link /DEBUG /NOLOGO /DLL /DEF:xpcvcdll.def /Include:_mallocD:\MATLAB6p1\toolbox\rtw\targets\xpc\target\build\lib\rttheap.lib rtwlib.lib@trial1_sfun.lnk -out:trial1_sfun.dll Creating library trial1_sfun.lib and object trial1_sfun.exp trial1_sfun.obj : error LNK2001: unresolved external symbol _cnt trial1_sfun.dll : fatal error LNK1120: 1 unresolved externals NMAKE : fatal error U1077: 'link' : return code '0x460' Stop.
I do not get this error when I build the model and I replace "Blk1" with "subsys1" (the original subsystem).
Best Answer