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
相关推荐
CodeYp20193 小时前
第14讲:mmap 实现文件 LRU 缓存
linux·lru·mmap
程序开发阿元3 小时前
一台 20G 的 VPS 被日志吃掉一半:我按这个顺序查了二十分钟
linux·ssh
.冰块.4 小时前
流量大了自动加 Pod!K8s HPA 扩缩容与 ResourceQuota/LimitRange 资源管控实战
linux·云原生·容器·kubernetes·hpa·quota·limitrange
承渊政道4 小时前
Linux网络学习【深入理解多路转接select、poll的代码改写】
linux·ubuntu·select·多路转接·poll
雪落漂泊4 小时前
Linux进程(四)概念:命令行参数和环境变量篇
linux·运维·服务器
qq_377572774 小时前
linux x86 arm loongarch
linux
Dragon~Snow5 小时前
Centos Stream10 安装 MySQL-9.7.2-linux-glibc2.28-x86_64.tar
linux·mysql·centos
say_fall5 小时前
【Linux系统编程】Linux进程信号:从“外卖到了“到内核里的一张位图
linux·运维·服务器·车载系统·智能硬件
坤坤子吖5 小时前
Linux网络编程:UDP进阶,从字典服务器到简单聊天室
linux·服务器·网络·c++·笔记·学习
Rabitebla5 小时前
【Linux学习笔记】进程篇(九):进程的创建与退出——fork、写时拷贝与退出码
linux·c++·笔记·学习