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
相关推荐
光而不耀@lgy8 分钟前
C++初登门槛
linux·开发语言·网络·c++·后端
偶尔微微一笑18 分钟前
AI网络渗透kali应用(gptshell)
linux·人工智能·python·自然语言处理·编辑器
Run1.28 分钟前
深入解析 Linux 中动静态库的加载机制:从原理到实践
linux·运维·服务器
The Mr.Nobody40 分钟前
STM32MPU开发之旅:从零开始构建嵌入式Linux镜像
linux·stm32·嵌入式硬件
老兵发新帖1 小时前
Ubuntu 上安装 Conda
linux·ubuntu·conda
秋秋秋秋秋雨1 小时前
linux安装单节点Elasticsearch(es),安装可视化工具kibana
linux·elasticsearch·jenkins
码农hbk2 小时前
linux ptrace 图文详解(七) gdb、strace跟踪系统调用
linux·服务器
hotlinhao2 小时前
ThinkPHP6模型中多组条件逻辑或Or查询的使用
linux·服务器·数据库
Jogging-Snail2 小时前
从零开始掌握Linux数据流:管道与重定向完全指南
linux·运维·管道·重定向·linux 数据流·管道原理
niuTaylor2 小时前
Linux驱动开发快速上手指南:从理论到实战
linux·运维·开发语言·驱动开发·c#