Simulink crashes when libstdc++.so.6 is replaced

조회 수: 7 (최근 30일)
Goksan ISIL
Goksan ISIL 2019년 5월 9일
댓글: Stefan 2023년 9월 5일
Hi,
I'm using Matlab 2017b for Linux, and since Im getting the `GLIBCXX_3.4.21' not found' error when I'm compiling my s-func which includes a mex file that was built with gcc 5.x, I tried to follow the following post https://se.mathworks.com/matlabcentral/answers/329796-issue-with-libstdc-so-6
As suggested in this post I have tried to replace the libstdc++.so.6 under matlab installation path with the /usr/lib/x86_64-linux-gnu/libstdc++.so.6, but when I do this my model crashes immediately when I try to compile it.
I have realized that it is also immediately crashing when I completely delete the ibstdc++.so.6 under matlab installation path, or just create symbolic link to the /usr/lib/x86_64-linux-gnu/libstdc++.so.6.
Are there additional changes required?

답변 (1개)

Pruthvi Muppavarapu
Pruthvi Muppavarapu 2019년 5월 13일
Hi Goksan,
The issue might be due to incompatibility between the libstc++ shipped by MATLAB and the libstdc++ shipped with the system. Try to update the Standard C++ library in your Linux distribution the below steps:
  • Open terminal and run the command:
sudo apt –get install libstdc++
  • Re-launch Matlab.
  • If the issue persists, then run the follwing commands in the termina:
sudo add -apt -repository ppa:ubuntu-toolchain-r/test
sudo apt -get update
sudo apt -get upgrade
sudo apt -get dist-upgrade
Regards,
Pruthvi
  댓글 수: 2
Goksan ISIL
Goksan ISIL 2019년 5월 13일
편집: Goksan ISIL 2019년 5월 14일
Thanks for the suggestion Pruthvi.
When I have investigated the core dump, I have actually realized that the reason for the crash was that Matlab was looking for the wrong version of the libprotobuf.so, compared to the libprotobuf that I've used to generate my mex function.
I've used legacy code tool to generate a mex function and specified protobuf 3.5 version installation for the dependency folder. But when Matlab calls this mex function, it somehow tries to use it's own libprotobuf.so (an older version). Renaming the libprotobuf.so under matlab install directory to .old seems to allow me to run the mex function, but I guess since some internal matlab tools is using this libprotobuf.so library, I see some errors in the Matlab terminal like "error in matlab.internal.webwindow"
Luckily, these errors dont interfere with the simulation
Stefan
Stefan 2023년 9월 5일
Hi @Goksan ISIL could you let me know how you found out libprotobuf was causing the issue. Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by