Simulink Winsock linker problem
Show older comments
Hi all, We are implementing a simple TCP/IP communication block in Simulink.
To this purpose we wrote an S-Function that we compile successfully with the following command: >> mex -O mytcpip.c WS2_32.lib -DWIN32
When we build the relevant model, the RTW generation code fails with the following log:
C:\Programmi\MATLAB7\work\xnet_grt_rtw>"C:\Programmi\MATLAB7\rtw\bin\win32\gmake" -f xnet.mk ADD_MDL_NAME_TO_GLOBALS=1 C:\Programmi\MATLAB7\sys\lcc\bin\lcc -c -Foxnet.obj -DUSE_RTMODEL -DMODEL=xnet -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -DHAVESTDIO -I. -I.. -IC:\Programmi\MATLAB7\simulink\include -IC:\Programmi\MATLAB7\extern\include -IC:\Programmi\MATLAB7\rtw\c\src -IC:\Programmi\MATLAB7\rtw\c\libsrc -IC:\Programmi\MATLAB7\rtw\c\src\ext_mode\common -IC:\Programmi\MATLAB7\rtw\c\src\ext_mode\tcpip -IC:\Programmi\MATLAB7\rtw\c\src\ext_mode\serial -IC:\Programmi\MATLAB7\rtw\c\src\ext_mode\custom -Ic:\programmi\matlab7\work -Ic:\programmi\matlab7\work\xnet_grt_rtw -Ic:\programmi\matlab7\rtw\c\libsrc -IC:\Programmi\MATLAB7\sys\lcc\include -noregistrylookup xnet.c C:\Programmi\MATLAB7\sys\lcc\bin\lcc -c -Fort_nonfinite.obj -DUSE_RTMODEL -DMODEL=xnet -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -DHAVESTDIO -I. -I.. -IC:\Programmi\MATLAB7\simulink\include -IC:\Programmi\MATLAB7\extern\include -IC:\Programmi\MATLAB7\rtw\c\src -IC:\Programmi\MATLAB7\rtw\c\libsrc -IC:\Programmi\MATLAB7\rtw\c\src\ext_mode\common -IC:\Programmi\MATLAB7\rtw\c\src\ext_mode\tcpip -IC:\Programmi\MATLAB7\rtw\c\src\ext_mode\serial -IC:\Programmi\MATLAB7\rtw\c\src\ext_mode\custom -Ic:\programmi\matlab7\work -Ic:\programmi\matlab7\work\xnet_grt_rtw -Ic:\programmi\matlab7\rtw\c\libsrc -IC:\Programmi\MATLAB7\sys\lcc\include -noregistrylookup rt_nonfinite.c C:\Programmi\MATLAB7\sys\lcc\bin\lcclnk -s -LC:\Programmi\MATLAB7\sys\lcc\lib -o ../xnet.exe xnet.obj rt_nonfinite.obj grt_main.obj rt_sim.obj mytcpip.obj C:\Programmi\MATLAB7\rtw\c\lib\win32\rtwlib_lcc.lib mytcpip.obj .text: undefined reference to '_WSAStartup@8'
Build error: Error using ==> RTW.makertw.make_rtw Error using ==> rtw_c Error(s) encountered while building model "xnet"
Model error: Error building Real-Time Workshop target for block diagram 'xnet'. MATLAB error message: Error using ==> slbuild Error using ==> RTW.makertw.make_rtw Error using ==> rtw_c Error(s) encountered while building model "xnet"
Any suggestion?
Tnx
Answers (0)
Categories
Find more on Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!