16001.WSL2 ubuntu20.04 编译安装 vsomeip

文章目录

  • [1 vsomeip 编译安装](#1 vsomeip 编译安装)
    • [1.1 vsomeip的安装](#1.1 vsomeip的安装)
    • [1.2 编译提示错误](#1.2 编译提示错误)
    • [1.3 编译hello_world示例](#1.3 编译hello_world示例)
    • [1.4 运行服务器端](#1.4 运行服务器端)

1 vsomeip 编译安装

1.1 vsomeip的安装

参考博文 https://blog.csdn.net/peterwanye/article/details/128386539

1.2 编译提示错误

bash 复制代码
ubuntu@1-BJ-EE1000042:~/opt/vsomeip-3.4.10/build$ cmake -DENABLE_MULTIPLE_ROUTING_MANAGERS=1 ..
c 复制代码
Cloning into 'googletest-src'...
fatal: unable to access 'https://github.com/google/googletest.git/': gnutls_handshake() failed: Error in the pull function.
Cloning into 'googletest-src'...
fatal: unable to access 'https://github.com/google/googletest.git/': gnutls_handshake() failed: Error in the pull function.
Cloning into 'googletest-src'...
fatal: unable to access 'https://github.com/google/googletest.git/': gnutls_handshake() failed: Error in the pull function.
-- Had to git clone more than once:
          3 times.
CMake Error at googletest-subbuild/googletest-populate-prefix/tmp/googletest-populate-gitclone.cmake:31 (message):
  Failed to clone repository: 'https://github.com/google/googletest.git'
  • 修改CMakeLists.txt 添加GTEST_ROOT 路径.
c 复制代码
set(GTEST_ROOT "/home/ubuntu/opt/googletest-src")

if (NOT GTEST_ROOT)
    if (DEFINED ENV{GTEST_ROOT})
        set(GTEST_ROOT $ENV{GTEST_ROOT})
    else()
        include(FetchContent)
        FetchContent_Declare(googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG v1.14.0) 
        FetchContent_Populate(googletest)
        set(GTEST_ROOT ${googletest_SOURCE_DIR})
    endif()
endif()

1.3 编译hello_world示例

  • 在hello_world工程目录下,创建目录build,执行cmake .. 在进行make编译.

1.4 运行服务器端

bash 复制代码
ubuntu@1-BJ-EE1000042:~/opt/vsomeip-3.4.10/examples/hello_world/build$ VSOMEIP_CONFIGURATION=../helloworld-local.json VSOMEIP_APPLICATION_NAME=hello_world_service ./hello_world_service
bash 复制代码
ubuntu@1-BJ-EE1000042:~/opt/vsomeip-3.4.10/examples/hello_world/build$ VSOMEIP_CONFIGURATION=../helloworld-local.json VSOMEIP_APPLICATION_NAME=hello_world_client ./hello_world_client
相关推荐
海棠蚀omo1 小时前
Linux基础I/O-打开新世界的大门:文件描述符的“分身术”与高级重定向
linux·操作系统
带土11 小时前
33. 文件IO (4) 二进制文件操作与结构体存储 文件路径与目录操作
linux
无敌最俊朗@2 小时前
C++音视频就业路线
linux·windows
Fr2ed0m2 小时前
Linux 文本处理完整指南:grep、awk、sed、jq 命令详解与实战
linux·运维·服务器
大聪明-PLUS2 小时前
使用 GitLab CI/CD 为 Linux 创建 RPM 包(一)
linux·嵌入式·arm·smarc
边疆.2 小时前
【Linux】自动化构建工具make和Makefile和第一个系统程序—进度条
linux·运维·服务器·makefile·make
2021黑白灰2 小时前
windows11 vscode ssh远程linux服务器/虚拟机 免密登录
linux·服务器·ssh
z202305082 小时前
linux之PCIE 设备枚举流程分析
linux·运维·服务器
simple_whu3 小时前
编译tiff:arm64-linux-static报错 Could NOT find CMath (missing: CMath_pow)
linux·运维·c++
SundayBear3 小时前
Linux驱动开发指南
linux·驱动开发·嵌入式