如何调试 Matlab/Simulink:Unable to launch the MATLABWindow application
问题
在你的 Matlab 或 Simulink 应用程序中,你看到如下错误消息
matlab-window-error.txt
Error using matlab.internal.webwindow (line 313)
MATLABWindow application failed to launch. Unable to launch the MATLABWindow application如何调试
你可以使用以下命令单独测试此问题
matlab-webwindow-repro.m
>> ww = matlab.internal.webwindow('www.mathworks.com'); ww.bringToFront;示例输出:
matlab_webwindow_repro_output.txt
>> 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一旦你验证了这一点,使用以下命令测试(来源:Arch Linux wiki)
运行该命令时,你会看到如下错误消息
matlab-symbol-lookup.txt
/opt/matlab/2018b/bin/glnxa64/MATLABWindow: symbol lookup error: /lib/x86_64-linux-gnu/libharfbuzz.so.0: undefined symbol: FT_Get_Color_Glyph_Layer(错误消息通常不同,但与某些共享库有关)
解决方案
在这种特定情况下,系统安装的 libharfbuzz.so.0 尝试加载 Matlab 的 freetype 库(libfreetype.so.6),该库与系统的 freetype 库不兼容。
在这种特定情况下,我可以通过重命名 Matlab 的 libfreetype.so.6 来修复此问题:
mv-matlab-freetype.sh
sudo mv /opt/matlab/2018b/sys/os/glnxa64/libfreetype.so.6 /opt/matlab/2018b/sys/os/glnxa64/libfreetype.so.6.bak这样,Matlab 将使用系统的 libfreetype.so.6,它(在实践中)与系统的 libharfbuzz.so.0 兼容。
之后,重启 Matlab,问题应该得到解决。
matlab-webwindow-test.m
>> ww = matlab.internal.webwindow('www.mathworks.com'); ww.bringToFront;Check out similar posts by category:
MATLAB/Simulink
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow