How to call .dll document in RTW

I am using the Real time workshop(RTW) to create .exe software.I have chose "rtwin.tlc" as my "System target file", "rtwintmf" as my "Template makefile", "make_rtw" as my "Make command".
In my .mdl document,I have used a S-function block in which it used some Windows API function。When the "build" button was pressed
down,there were some errors reported in the Matlab comment window as follows:
Could Anybody tell me how to solve this problom?
-export:GetBoards
Creating library ..\RTW_send.lib and object ..\RTW_send.exp
rtwsend.obj : error LNK2001: unresolved external symbol __imp__htons@4
rtwsend.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
rtwsend.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0
rtwsend.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
rtwsend.obj : error LNK2001: unresolved external symbol __imp__socket@12
rtwsend.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8
rtwsend.obj : error LNK2001: unresolved external symbol __imp__Sleep@4
rtwsend.obj : error LNK2001: unresolved external symbol __imp__sendto@24
rtwsend.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
..\RTW_send.rwd : fatal error LNK1120: 9 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2011년 6월 27일

0 개 추천

According to this page in the Real-Time Windows Target (RTWT) documentation, Win32 API calls are not allowed in custom drivers blocks written for RTWT.
Regardless, to fix the linker error, you may just need to add the paths to the corresponding libraries to the model's Custom Code pane in the Real-Time Windows (or Code Generation) tab of the Configuration Parameters window.

카테고리

도움말 센터File Exchange에서 Debugging and Improving Code에 대해 자세히 알아보기

질문:

ma
2011년 6월 25일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by