Windows源码编译ros2(rolling版本)

参考步骤:

https://docs.ros.org/en/rolling/Installation/Alternatives/Windows-Development-Setup.html#get-ros-2-code

1)新建src目录:

C:\ros\rolling>vcs import --input https://gitcode.net/rose3/rose3/-/raw/master/ros2.rolling.repos src

2)run within a Visual Studio Command Prompt

c:\ros\rolling>colcon build --merge-install --cmake-args  -G "Visual Studio 17 2022" -A x64

问题1:

--- stderr: fastcdr
CMake Error at CMakeLists.txt:84 (project):
  No CMAKE_CXX_COMPILER could be found.

出错的cmakelists.txe是:
project(fastcdr VERSION "${LIB_VERSION_STR}" LANGUAGES CXX)

是cmake和Windows SDK版本的问题,可能是安装了多个SDK(见https://blog.csdn.net/qq_39482438/article/details/81013100 第3种情况),把所有sdk删除再重新安装最新的SDK后问题解决)

问题2:

1 package failed: uncrustify_vendor

打印出错信息:--event-handlers console_direct+

colcon build --merge-install --cmake-args  -G "Visual Studio 17 2022" -A x64 --event-handlers console_direct+ --packages-select uncrustify_vendor

[Processing: uncrustify_vendor]
  === .\uncrustify_vendor (git) ===
  fatal: unable to access 'https://github.com/uncrustify/uncrustify.git/': Failed to connect to github.com port 443 after 21073 ms: Couldn't connect to server

ros2中,xxx_vendor的子工程,都是xxx的一个编译封装,cmake下载github失败就把下载地址改一下: https://gitcode.net/rose3/uncrustify_vendor/-/merge_requests/1

问题3:

 1 package failed: pybind11_vendor

Performing download step for 'pybind11_vendor'
  === .\pybind11_vendor (git) ===
  Could not determine ref type of version: fatal: unable to access 'https://github.com/pybind/pybind11.git/': Failed to connect to github.com port 443 after 21061 ms

 如果要查看具体编译错误,可以使用一下参数: --event-handlers console_direct+

例如:

colcon build --merge-install --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo --packages-up-to pybind11_vendor

问题4:

Could NOT find Bullet (missing: BULLET_DYNAMICS_LIBRARY
  BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY BULLET_SOFTBODY_LIBRARY
  BULLET_INCLUDE_DIR)

源码编译安装:https://gitcode.net/rose3/bullet3.git

修正了原master branch中的cmake错误。

cmake编译选项:-DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON -DINSTALL_LIBS=ON

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值