win10下使用fastdds
参照网址:https://www.cnblogs.com/edkong/p/16522836.html
需要安装的软件和用处:
- Visual Studio,用于打开和编译fastdds示例工程。下载地址:下载 Visual Studio Tools - 免费安装 Windows、Mac、Linux
- Cmake,用于将fastdds源码产生visual studio工程。下载地址:Download CMake
- Openssl,用于cmake生成visual studio工程。下载地址:Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions
- fastdds,源码及cmake文件。下载地址:Downloads
上述软件版本均是基于当时最新的版本:
- Visual Studio : visual studio 2022
- Cmake : cmake-3.28.1-windows-x86_64.msi
- Openssl : Win64OpenSSL-3_2_0.msi
- fastdds : eProsima_Fast-DDS-2.12.1-Windows.exe
先根据上述网址安装软件,并将Openssl添加到环境变量中。
当按照上述操作时会报如下错误:
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19044.
-- The CXX compiler identification is MSVC 19.38.33133.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: d:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at D:/Program Files/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
D:/Program Files/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
D:/Program Files/CMake/share/cmake-3.28/Modules/FindOpenSSL.cmake:668 (find_package_handle_standard_args)
D:/Program Files/eProsima/fastrtps 2.12.1/share/fastrtps-x64Win64VS2019/cmake/fastrtps-config.cmake:58 (find_package)
D:/Program Files/eProsima/fastrtps 2.12.1/share/fastrtps-x64Win64VS2019/cmake/fastrtps-config.cmake:96 (find_fastdds_deployed_openssl)
D:/Program Files/eProsima/fastrtps 2.12.1/share/fastrtps-x64Win64VS2019/cmake/fastrtps-config.cmake:119 (fastrtps_load_targets)
CMakeLists.txt:25 (find_package)
-- Configuring incomplete, errors occurred!
打开cmake图形化界面,按照如下步骤进行:
使用visual studio 打开项目或解决方案,选择DDSHelloWorldExample.sln,点击菜单 生成->生成解决方案,编译通过。
在目录 build/Debug中运行DDSHelloWorldExample.exe,如下所示:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!