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
相关推荐
WuYiCheng66611 分钟前
CentOS高手之路:从进阶实战到企业级优化
linux·运维·centos
猴子请来的逗比48912 分钟前
mysql的安装方式
linux·数据库·学习·mysql
非自律懒癌患者43 分钟前
ubuntu 20.04 ping baidu.coom可以通,ping www.baidu.com不通 【DNS出现问题】解决方案
linux·tcp/ip·ubuntu
Xam_d_LM43 分钟前
【Linux】如何清除 Ubuntu 留下的 EFI 分区,Windows 磁盘管理器右键删除卷是灰色
linux·运维·windows·ubuntu·重装系统·磁盘管理器
黄暄1 小时前
Linux项目部署全攻略:从环境搭建到前后端部署实战
java·linux·运维·服务器·前端·后端·持续部署
独行soc2 小时前
2025年渗透测试面试题总结-安恒[实习]安全服务工程师(题目+回答)
linux·数据库·安全·web安全·面试·职场和发展·渗透测试
L汐2 小时前
01 CentOS根分区满了扩容
linux·运维·centos
小峰编程2 小时前
Python函数——万字详解
linux·运维·服务器·开发语言·前端·网络·python
大筒木老辈子2 小时前
Linux笔记---内核态与用户态
linux·运维·笔记
五花肉村长3 小时前
Linux-进程信号
linux·运维·服务器·开发语言·网络·c++