Simulink Error: Invalid MEX-File <File Name>: the specified module could not be found when using newly generated library block

3 次查看(过去 30 天)
Hi,
I have read all of the posts I can find regarding this error and have as of yet been unable to find a solution to the problem. Recently, I generated two new library blocks (using r2016a) for a custom library that we have for what will become our new flagship product. Until now, we have had no problems with this and I changed absolutely nothing in the process of generating the associated S-Functions from what I had done with the other blocks in the library. I tested everything and it all works wonderfully on my machine, however when I distribute the new files to my associate for use in our state machine (Simulink/Stateflow), he cannot get the model to simulate. He gets the following error:
Error while obtaining sizes from MEX S-function 'sfun_Write_UL_To_LCD' in 'VN_LTE/LCD_Display/LCD_Update/Display Underscores/S-Function'.
Caused by:
· Invalid MEX-file 'C:\CubbyMyDocuments\Code ARM\MATLAB\EFM ARM Libraries\MATLAB code\MLibraries\LCD\sfun_Write_UL_To_LCD.mexw64': The specified module could not be found.
As suggested in another post, I have used the dependency viewer on both of our machines and there is a glaring difference on his machine in that a lot of the dependencies can't be found. (See attached screen shot of dependency viewer from his machine).
The confusion is that since nothing has changed on my end in generating the .mexw64 files and supposedly nothing has changed on his end executing the files, why do all of the previous blocks function correctly and only these new ones generate an issue?
The process I go through for making the blocks is as follows:
1. Use the S-Function builder to generate all of the necessary files to call a custom written C function.
2. Create subsystem in the associated library which simply uses the newly generated S-Function.
3. Distribute all generated files (with the exception of the SFB*.mat files) and the library which uses them.
Simple.
As always, thanks in advance for your help. Here is the screen shot of his dependency viewer:
  5 个评论
Chris Hack
Chris Hack 2016-7-29
Results on my computer:
>> computer
ans =
PCWIN64
>> computer arch
ans =
win64
Results on his computer:
>> computer
ans =
PCWIN64
>> computer arch
ans =
win64

请先登录,再进行评论。

采纳的回答

Chris Hack
Chris Hack 2016-8-2
So I was able to figure out the issue causing this particular problem. I had installed Microsoft Visual Studio 2015 and without any type of question or warning MATLAB decided to switch compilers from the Windows SDK V 7.1 to the Visual Studio 2015 compiler. Apparently, the Visual Studio 2015 and Visual Studio 2012 compilers are not compatible in a significant enough way to cause dependency errors when Simulink tries to run the .mexw64 files.
In order to debug the issue, we both ran the command
mex -setup
and compared the results. Thank you everyone for your help on this issue.

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by