MATLAB Answers

ModelSim - MATLAB cosimulation not running!!!

13 views (last 30 days)
After starting the cosimulation in modelsim version 10.4a (by running vsimulink work.inverter) I get the following error:
# Loading D:/Program Files/MATLAB/R2017b/toolbox/edalink/extensions/modelsim/windows32/liblfmhdls_gcc421vc12.dll # Error: (vsim-3193) Load of "D:/Program Files/MATLAB/R2017b/toolbox/edalink/extensions/modelsim/windows32/liblfmhdls_gcc421vc12.dll" failed: Bad DLL format. # # Warning: (vsim-FLI-3160) Failed to load FLI object file "D:/Program Files/MATLAB/R2017b/toolbox/edalink/extensions/modelsim/windows32/liblfmhdls_gcc421vc12.dll".
I searched online and found some people saying its a 64 bit, 32 bit version problem. But the file is clearly seemed to be inside "windows32/" folder.
How can I fix this error? Stuck here for hours. Anykind of help will be very much appreciated. Thank you.

Accepted Answer

Tao Jia
Tao Jia on 9 Feb 2018
First, we need to determine if your ModelSim is 32-bit or 64bit. The easiest way to check this is to look at the title of ModelSim window. If it says something like "ModelSim SE-64", then you have a 64 bit ModelSim. In that case, we are loading the wrong DLL (32bit) into your ModelSim. We can further investigate why it does not work.
If there is no "-64" in your window title, then you do have a 32-bit ModelSim. It might be the problem that you don't have the visual studio redistribute installed in your machine. The shared DLL that we compiled requires Visual Studio 2013 redistribute. You can get it from Microsoft website here:
You'll need to make sure that you installed the 32-bit version.
Let me know if you still have problem. Also, please let me know the ModelSim type that you have, is it SE, PE, or DE version?
  1 Comment
Md. Fahim Faysal
Md. Fahim Faysal on 15 Feb 2018
Thanks a lot for the reply. I have found the problem. I did not have Visual Studio 2013 redistribute. I had 2012, 2015 but not 2013. I have downloaded and installed the 2013 C++ redistribute and it worked like a charm!!
Thank you very much once again, really appreciate the help. Regards

Sign in to comment.

More Answers (1)

Md. Fahim Faysal
Md. Fahim Faysal on 15 Feb 2018
Also I found another way around. If we use liblfmhdls_gcc421vc 9.dll instead of liblfmhdls_gcc421vc 12.dll that comes with R2017b, then it also works. The liblfmhdls_gcc421vc 9.dll can be found with R2013a. Thank you.

Community Treasure Hunt

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

Start Hunting!