What causes an "Unable to load DLL dependency: KERNEL32.d​ll.GetFile​SizeEx" error on the target screen when attempting to load an SLRT application in R2018b or prior?

43 views (last 30 days)
When building a Simulink model for Simulink Real-Time (SLRT) with the latest version of Microsoft Visual Studio C++ 2017, the following error is shown on the target screen (or obtained using the command "tg.viewTargetScreen") when attempting to load the application.
ERROR: Unable to load DLL dependency: KERNEL32.dll.GetFileSizeEx
Loading C:\​private\​xpcosc.dlm failed with error 127
Error: Could not load model C:\​private\​xpcosc: 127
When running the command "slrttest" the error might appear as:
>> slrttest
### Simulink Real-Time Test Suite ### Host-Target interface is: TcpIp
### Test 1, Ping target computer 'TargetPC1' using system ping: ... OK
### Test 2, Ping target computer 'TargetPC1' using SLRTPINGTARGET: ... OK
### Test 3, Software reboot the target computer 'TargetPC1': ...... OK
### Test 4, Build and download a Simulink Real-Time application using model slrttestmdl to target computer 'TargetPC1': ...
Warning: Error occurred while executing the listener callback for event Loaded defined for class
MathWorks.xPCTarget.FrameWork.xPCTargetPC:
Error using SimulinkRealTime.target/XCPLoadedCB
Enter a valid application name
> In SimulinkRealTime.target/loa
  In slrttest (line 212)
OK
### Test 5, Check host-target command communications with 'TargetPC1': ... FAILED
When building a model for SLRT, you may see the following warnings and errors:
### Download model onto target: TargetPC1
Warning: Error occurred while executing the listener callback for event Loaded defined for class
MathWorks.xPCTarget.FrameWork.xPCTargetPC:
Error using SimulinkRealTime.target/XCPLoadedCB
Enter a valid application name
### Create SimulinkRealTime.target object tg
Error using coder.internal.callMakeHook
The call to slrt_make_rtw_hook, during the exit hook generated the following error:
Invalid Simulink object name: loader
The build process will terminate as a result.<...>
Caused by:
    Error using dispIfVerbose (line 31)
    Invalid Simulink object name: loader
        Error using dispIfVerbose (line 31)
        No block diagram 'loader' is loaded.
Additionally, the following warning may appear in Diagnostic Viewer:
Warning: Streaming to SDI is not available: Could not connect to XCP slave: XCP Master internal error: Connect failed

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 12 May 2022
Edited: MathWorks Support Team on 3 Jan 2022
Please refer to the following bug report for fixes and workarounds:
  7 Comments
ran ran
ran ran on 25 Feb 2022
The problem is caused by Win10SDK 10.0.17763.0,check out whether it is still existing in your ControlPanel.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!