How to debug Matlab/Simulink: Unable to launch the MATLABWindow application
Problem
During your Matlab or Simulink application, you see an error message such as
Error using matlab.internal.webwindow (line 313)
MATLABWindow application failed to launch. Unable to launch the MATLABWindow application
How to debug
You can test this in isolation using
>> ww = matlab.internal.webwindow('www.mathworks.com'); ww.bringToFront;
Example output:
>> ww = matlab.internal.webwindow('www.mathworks.com'); ww.bringToFront;
Error using matlab.internal.webwindow (line 313)
MATLABWindow application failed to launch. Unable to launch the MATLABWindow application
Once you have verified that, test using (source: Arch Linux wiki)
When running that, you’ll see an error message like
/opt/matlab/2018b/bin/glnxa64/MATLABWindow: symbol lookup error: /lib/x86_64-linux-gnu/libharfbuzz.so.0: undefined symbol: FT_Get_Color_Glyph_Layer
(the error message is typically different but related to some shared library)
Solution
In this particular case libharfbuzz.so.0
from the system installations tries to load Matlab’s freetype library (libfreetype.so.6
) which is incompatible with the system’s freetype library.
In this particular case, I could fix this by renaming the Matlab libfreetype.so.6
:
sudo mv /opt/matlab/2018b/sys/os/glnxa64/libfreetype.so.6 /opt/matlab/2018b/sys/os/glnxa64/libfreetype.so.6.bak
This way, Matlab will use the system’s libfreetype.so.6
which is (in practice) compatible with the system’s libharfbuzz.so.0
.
After that, restart Matlab and the issue should be resolved.
>> ww = matlab.internal.webwindow('www.mathworks.com'); ww.bringToFront;