Why do I get the error: "Error in ros.intern​al.utiliti​es.checkAn​dGetCompat​ibleCompil​ersLocatio​n (line 73)"?

34 Ansichten (letzte 30 Tage)
Hi,
I'm trying to implement some ROS2 custom messages into Matlab and I've not found a solution yet.
I downloaded the following repo: https://github.com/ros2/common_interfaces.git
In order to recreate the errors:
  • download the repo (I choose to clone it in the home);
  • open Matlab and move to this folder;
  • give the following command in the command window
ros2genmsg(".")
After this, I get these errors:
>> ros2genmsg(".")
Identifying message files in folder '/home/alberto/common_interfaces'..Validating message files in folder '/home/alberto/common_interfaces'..Done.
Done.
[0/11] Generating MATLAB interfaces for custom message packages... 0%Error using ()
Key not found.
Error in ros.internal.utilities.checkAndGetCompatibleCompilersLocation (line 73)
matlabInCompatibleCompilerVer = supportedCompilerVersions(matlabLIBSTDCXXVersionNum+1);
Error in ros.internal.ROSProjectBuilder (line 453)
[h.GccLocation, h.GppLocation] = ros.internal.utilities.checkAndGetCompatibleCompilersLocation();
Error in ros.ros2.internal.ColconBuilder (line 26)
h@ros.internal.ROSProjectBuilder(varargin{:});
Error in ros2genmsg (line 278)
builder = ros.ros2.internal.ColconBuilder(genDir, pkgInfos{iPkg}, UseNinja=useNinja, SuppressOutput=suppressOutput);
I tried to recompile ROS packages and even to change compilers' version, but I can't find a way out.
I'm working on Ubuntu 22.04, the Matlab version that I'm using is:
MATLAB Version: 23.2.0.2599560 (R2023b) Update 8
Operating System: Linux 6.5.0-45-generic #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 15 16:40:02 UTC 2 x86_64
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Following, I'm reporting versions of gcc, g++, Python, cmake and ROS:
  • gcc (Ubuntu 10.5.0-1ubuntu1~22.04) 10.5.0
  • g++ (Ubuntu 10.5.0-1ubuntu1~22.04) 10.5.0
  • Python 3.10.12
  • cmake 3.22.1
  • ROS2 humble
Thanks for the help.
  4 Kommentare
Alberto Piccina
Alberto Piccina am 13 Aug. 2024
Hi,
after running the requested lines of code, I obtained this:
>> matlabLIBSTDCXXVersion
matlabLIBSTDCXXVersion =
'strings: '/usr/local/MATLAB/R2023b/sys/os/glnxa64/libstdc++.so.6': No such file
'
Sorry, but there is not any log file, the only hyperlinks in these error are the functions 'ros.internal.utilities.checkAndGetCompatibleCompilersLocation', 'ros.internal.ROSProjectBuilder', 'ros.ros2.internal.ColconBuilder', 'ros2genmsg' and they refer to the documentation.
decs
decs am 23 Okt. 2024 um 14:57
Hi Alberto,
Did you find a solution for this problem? I am stuck with the same error, but it hasn't been resolved by the suggestions given so far.
Thanks,
Declan

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Garmit Pant
Garmit Pant am 13 Aug. 2024
Hello Alberto
The error you are facing is due to missing libraries. Based on the investigation of the error and the output of the matlabLIBSTDCXXVersion’ reflecting “No such file”, it is evident that the C++ standard library shipped with MATLAB is missing. The symbolic link libstdc++.so.6’ is not present in the MATLAB installation folder on your system.
This can be resolved by re-installing MATLAB on your system, which will ensure that all the necessary libraries are installed.
Alternatively, you can install the ‘matlab-support’ package to configure MATLAB to integrate with the Linux distro. You can install this package by using the following command in the terminal:
sudo apt-get install matlab-support
I hope you find the above explanation and suggestions useful!

Weitere Antworten (0)

Kategorien

Mehr zu Custom Message Support finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by