ROS2 compile a standalone node: undefined references to `std::__throw_bad_array_new_length()'
11 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I am trying to create a standalone node for ROS2 with a publisher (see schema below) and I am using the following tutorial to set up the model to generate the code:
but when I compile it, I obtain the following error
undefined reference to `std::__throw_bad_array_new_length()
and I don't find a way to fix (below the imag with the error). I also got the same error with the Simulink model used in the tutorial.
System info:
- OS: Ubuntu 22.04 LTS
- ROS2 version: Humble
- gcc version: 11.4.0
0 件のコメント
採用された回答
Josh Chen
2024 年 5 月 17 日
Hi Federico,
Thanks for providing the system information. This error seems to be a compiler incompatible issue.
In R2023b version of MATLAB/Simulink, some internal packages were built with gcc-10. Hence, when compiling the Simulink model with gcc-11, you may see undefined reference errors.
This issue was resolved in the upcoming R2024b version, which uses gcc-12 to build those packages.
As a workaround for R2023b, you could consider installing gcc-10 on your machine so that the entire project uses the same gcc version during build process.
Best,
Josh
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!