Ubuntn 22.04 + ROS2 humble,在colcon build 时遇到报错如下:粘贴了主要部分,报错很长
--- stderr: examples_rclcpp_async_client
/usr/local/bin/cmake: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/colcon_core/executor/__init__.py", line 91, in __call__
rc = await self.task(*args, **kwargs)
File "/usr/lib/python3/dist-packages/colcon_core/task/__init__.py", line 93, in __call__
return await task_method(*args, **kwargs)
File "/usr/lib/python3/dist-packages/colcon_ros/task/ament_cmake/build.py", line 59, in build
rc = await extension.build(
File "/usr/lib/python3/dist-packages/colcon_cmake/task/cmake/build.py", line 87, in build
rc = await self._reconfigure(args, env)
File "/usr/lib/python3/dist-packages/colcon_cmake/task/cmake/build.py", line 182, in _reconfigure
buildfile = get_buildfile(cmake_cache)
File "/usr/lib/python3/dist-packages/colcon_cmake/task/cmake/__init__.py", line 112, in get_buildfile
if 'Ninja' in generator:
TypeError: argument of type 'NoneType' is not iterable
---
Failed <<< examples_rclcpp_async_client [3.45s, exited with code 1]
主要问题出在了:
usr/local/bin/cmake: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
然后网上有的是重新安装openssl.1.1.so,尝试了之后发现并没有用
最后在这里找到了相应的解决办法:
python - libssl.so.1.1: cannot open shared object file: No such file or directory - Stack Overflow
具体如下:
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
等待命令结束之后即可。