Why do I get error messages when compiling a model that contains an S-function block that uses the external S-function module in Real-Time Workshop?

2 次查看(过去 30 天)
I have a model that contains S-functions.
Under the S-function modules, I have put a library called user32.lib.
When I try to generate code for the GRT target, I receive the following errors:
### Linking ...
\\Mathworks\devel\archive\R2006a\perfect\matlab\sys\perl\win32\bin\perl \\Mathworks\devel\archive\R2006a\perfect\matlab\rtw\c\tools\mkvc_lnk.pl testss.lnk testss.obj rt_nonfinite.obj testss_data.obj grt_main.obj rt_sim.obj
link /RELEASE /INCREMENTAL:NO /NOLOGO -subsystem:console,4.0 kernel32.lib ws2_32.lib mswsock.lib advapi32.lib libcp.lib \user32.lib \\Mathworks\devel\archive\R2006a\perfect\matlab\rtw\c\lib\win32\rtwlib_vc.lib @testss.lnk -out:..\testss.exe
LINK : fatal error LNK1181: cannot open input file '\user32.lib'
NMAKE : fatal error U1077: 'link' : return code '0x49d'
Stop.
It seems that the file name "user32.lib" was converted to "\user32.lib" during Real-Time Workshop build process.

采纳的回答

MathWorks Support Team
This problem results from incorrect usage. The S-Function modules parameter should be used only to list source files. If an S-Function requires a specific library to be linked in, the full path to that library file should be specified via:
Configuration parameters -> Real-Time Workshop -> Custom Code -> Libraries
or by using the rtwmakecfg.m API
Information about using the rtwmakecfg.m API can be found in this URL:
<http://www.mathworks.com/help/releases/R2011a/toolbox/rtw/ug/bp67s_y-1.html#bp67trh>

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

产品


版本

R2006a

Community Treasure Hunt

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

Start Hunting!

Translated by