win10下使用fastdds

发布时间:2023年12月23日

参照网址:https://www.cnblogs.com/edkong/p/16522836.html

需要安装的软件和用处:

  1. Visual Studio,用于打开和编译fastdds示例工程。下载地址:下载 Visual Studio Tools - 免费安装 Windows、Mac、Linux
  2. Cmake,用于将fastdds源码产生visual studio工程。下载地址:Download CMake
  3. Openssl,用于cmake生成visual studio工程。下载地址:Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions
  4. fastdds,源码及cmake文件。下载地址:Downloads

上述软件版本均是基于当时最新的版本:

  1. Visual Studio : visual studio 2022
  2. Cmake : cmake-3.28.1-windows-x86_64.msi
  3. Openssl : Win64OpenSSL-3_2_0.msi
  4. 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,如下所示:

文章来源:https://blog.csdn.net/zisehuoxia/article/details/135170326
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。