cppMicroService 下载编译

1、下载最新release版本release-3.4版本

 

https://github.com/CppMicroServices/CppMicroServices/tree/release-3.4

 

2、编译:

(1)修改顶层CMakeLists.txt ,打开生成共享库以及编译example编译选项

us_cache_var(BUILD_SHARED_LIBS ON BOOL "Build shared libraries")
us_cache_var(CMAKE_DEBUG_POSTFIX d STRING "Executable and library debug name postfix" ADVANCED)

us_cache_var(US_ENABLE_THREADING_SUPPORT ON BOOL "Enable threading support")
us_cache_var(US_ENABLE_TSAN OFF BOOL "Enable tsan (thread sanitizer)" ADVANCED)
us_cache_var(US_ENABLE_COVERAGE OFF BOOL "Enable code coverage" ADVANCED)
us_cache_var(US_BUILD_TESTING OFF BOOL "Build tests")
us_cache_var(US_BUILD_EXAMPLES ON BOOL "Build example projects")
us_cache_var(US_USE_SYSTEM_GTEST OFF BOOL "Build using an external GTest installation" ADVANCED)

(2)创建build文件夹并编译

mkdir build && cd build
cmake ..
make -j4 

(3)运行测试程序

  ./bin/usTutorialDriver (然而包一堆错,原因是软连接问题,根据错误添加共享库的软连接)

如报一下错误:

nvidia@ubuntu:~/share/CppMicroServices-release-3.4/build$ ./bin/usTutorialDriver 
Failed to install bundle library at /home/nvidia/share/CppMicroServices-release-3.4/build/lib/libdictionaryserviced.so: /home/nvidia/share/CppMicroServices-release-3.4/build/lib/libdictionaryserviced.so does not exist

则添加软链接:

nvidia@ubuntu:~/share/CppMicroServices-release-3.4/build/lib$ ln -s libdictionaryservice.so libdictionaryserviced.so 

3、运行

 

posted @ 2020-07-14 00:02  youlin  阅读(1444)  评论(0编辑  收藏  举报