ros2编译python环境不匹配

solution_zoo common dir:
-- Found ament_cmake_auto: 0.9.11 (/opt/ros/foxy/share/ament_cmake_auto/cmake)
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find PythonInterp: Found unsuitable version "2.7.18", but
  required is at least "3" (found /usr/bin/python)

Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:391 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindPythonInterp.cmake:169 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  /opt/ros/foxy/share/ament_cmake_core/cmake/core/python.cmake:22 (find_package)
  /opt/ros/foxy/share/ament_cmake_core/cmake/core/all.cmake:53 (include)
  /opt/ros/foxy/share/ament_cmake_core/cmake/ament_cmake_core-extras.cmake:17 (include)
  /opt/ros/foxy/share/ament_cmake_core/cmake/ament_cmake_coreConfig.cmake:41 (include)
  /opt/ros/foxy/share/ament_cmake/cmake/ament_cmake_export_dependencies-extras.cmake:15 (find_package)
  /opt/ros/foxy/share/ament_cmake/cmake/ament_cmakeConfig.cmake:41 (include)
  /opt/ros/foxy/share/ament_cmake_auto/cmake/ament_cmake_auto-extras.cmake:17 (find_package)
  /opt/ros/foxy/share/ament_cmake_auto/cmake/ament_cmake_autoConfig.cmake:41 (include)
  solutionzoo/CMakeLists.txt:85 (find_package)

ros2环境配置python环境:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
 

继续编译会发现c++的配置全部都报错了:

/usr/include/c++/9/ctime:64:11: error: ‘::clock’ has not been declared
   64 |   using ::clock;
      |           ^~~~~
/usr/include/c++/9/ctime:65:11: error: ‘::difftime’ has not been declared
   65 |   using ::difftime;
      |           ^~~~~~~~
/usr/include/c++/9/ctime:66:11: error: ‘::mktime’ has not been declared
   66 |   using ::mktime;
      |           ^~~~~~
/usr/include/c++/9/ctime:67:11: error: ‘::time’ has not been declared
   67 |   using ::time;
      |           ^~~~
/usr/include/c++/9/ctime:68:11: error: ‘::asctime’ has not been declared
   68 |   using ::asctime;
      |           ^~~~~~~
/usr/include/c++/9/ctime:69:11: error: ‘::ctime’ has not been declared
   69 |   using ::ctime;
      |           ^~~~~
/usr/include/c++/9/ctime:70:11: error: ‘::gmtime’ has not been declared
   70 |   using ::gmtime;
      |           ^~~~~~
/usr/include/c++/9/ctime:71:11: error: ‘::localtime’ has not been declared
   71 |   using ::localtime;
      |           ^~~~~~~~~
/usr/include/c++/9/ctime:72:11: error: ‘::strftime’ has not been declared
   72 |   using ::strftime;
      |           ^~~~~~~~

添加的模块代码,ros1需要C++11支持,ros2需要C++14支持

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值