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
相关推荐
A ?Charis2 小时前
k8s-对接NFS存储
linux·服务器·kubernetes
DC_BLOG5 小时前
Linux-GlusterFS进阶配置
linux·运维·服务器
我们的五年6 小时前
MAC地址是如何在局域网中工作的?
linux
浮华落定7 小时前
Centos开机自启动
linux·运维·centos
去看日出7 小时前
CentOS 7 企业级Redis 7部署指南
linux·redis·centos
End9289 小时前
如何安装虚拟机cenos7系统
大数据·linux·运维
果汁分你一半l10 小时前
c++标准io与线程,互斥锁
linux·开发语言·c++·算法·vim
WineMonk10 小时前
CentOS查看IP地址
linux·centos
5:0010 小时前
Linux:进程间通信(一.初识进程间通信、匿名管道与命名管道、共享内存)
linux·运维·服务器
ARM+FPGA+AI工业主板定制专家11 小时前
Software PLC Solution for RK3568+Codesys ARM+LINUX Hardware Platform
linux·plc·rk3568·codesys