libmwi18n.dll, libmx.dll, libmat.dll could not be found when building code with slbuild

Hello everyone,
I'm trying to build a standalone executable file from simulink model with the command slbuild. This runs via Matlab without errors, but when I run the executable file externally (I mean double click on it), I get the error that some .dll files (libmwi18n.dll, libmx.dll, libmat.dll) could not found which are also in the matlab installation folder (matlabroot/bin/win64). How should create the executable file so that it also runs externally in another working folder?
I use this code for building and running:
% Build and run simulations
simulationStopTime = simulationStopTimeArray(1);
slbuild(models(modelNumber))
for k = 1:length(simulationStopTimeArray)
for iRepeat = 1:2
tic
eval(['!' modelName ' -tf ' num2str(simulationStopTimeArray(k))])
durationOfBuiltCodeRSim(k) = toc;
end
end
I would appreciate any tips on how to fix this error. Thanks.

Answers (1)

Hi Semih,
I understand that you are getting error “libmwi18n.dll, libmx.dll, libmat.dll could not be found “ while building a Simulink model with ‘slbuild’ command.
These errors may arise because of outdated build folders. This may lead the ‘packNGo’ to not find the DLL files.
To resolve the issue , I suggest you the following steps :-
  • Delete the 'slprj' folder and everything else from the build folder including the MEX files
  • Rebuild the model to generate the new MEX files, makefile and other build files.
I hope this resolves the issue you were facing.

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Products

Release

R2020b

Asked:

on 3 Jan 2022

Answered:

on 20 Nov 2023

Community Treasure Hunt

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

Start Hunting!