S function Impossible to Load library
显示 更早的评论
Hi All,
i have this problem when i tried to run a simulation with simulink,
Error reported by S-function 'mp_read_fields' in 'matlab_dll_read/Fields Reader/Read Fields': Impossible to load library
Is there any clue to what could possible causing this error?
Thank you
回答(2 个)
Kaustubha Govind
2012-8-14
编辑:Kaustubha Govind
2012-8-14
What do you get when you run these commands at your MATLAB prompt:
>> which mp_read_fields
Do you have access to the source code for this file? The error "Impossible to load library" doesn't seem like a standard error that Simulink or the OS would throw. My guess is that the file 'mp_read_fields' itself is reporting this error. Perhaps there some DLL dependencies that it cannot find on your machine?
Have you been able to get this S-function to work on any other machine?
3 个评论
K E
2012-8-14
I also suspect this is not a standard Simulink error: I did a web search for the error text you provided and Simulink, and came up with nothing.
asadilan
2012-8-14
Kaustubha Govind
2012-8-15
That kind of error typically implies missing module dependencies. Perhaps you should try profiling your DLL with Dependency Walker to see if it can't find certain DLLs. Also, is the DLL for the same platform (32-bit vs. 64-bit) as the S-function DLL? You can figure this out using DUMPBIN.
Image Analyst
2012-8-13
0 个投票
You probably didn't pass in the full path (folder + base filename) of the DLL or the filename was somehow otherwise not correct. You should always use exist(fullFileName, 'file') before calling LoadLibrary() to make sure the file exists, and alert the user if the file can't be found. For example, is 'matlab_dll_read/Fields Reader/Read Fields' the file name? Shouldn't it have a .DLL extension and a drive letter?
4 个评论
asadilan
2012-8-13
Walter Roberson
2012-8-13
'matlab_dll_read/Fields Reader/Read Fields' looks to me as if it is a Simulink block name.
It would be useful to know which library could not be loaded, and whether the attempt is being made in user code or in Simulink code that is expected to be transparent to the user.
Image Analyst
2012-8-13
If Walter is right, I can't help you since I just use the LoadLibrary() function in regular MATLAB and I don't have Simulink. But tell him what library you were trying to load.
asadilan
2012-8-14
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Environment Customization 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!