照着官方文档来,不过在mac下还是有些小坑

对熟悉c++的人来说很小儿科,但对c++相对比较外行 (只知道基本语法和部分数据结构)的人,还是作不到开箱即用

首先编译
```
If you need to enable cpu/heap profilers in examples:

brew install gperftools
If you need to run tests, install and compile googletest (which is not compiled yet):

git clone https://github.com/google/googletest && cd googletest/googletest && mkdir bld && cd bld && cmake .. && make && sudo mv libgtest* /usr/lib/ && cd -
```

报错

/Users/cclient/Work/Source/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h:67:60: error: expected class name
: public ParamGeneratorInterface< ::std::tuple<T1, T2> > {
^
/Users/cclient/Work/Source/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h:69:18: error: no template named 'tuple' in namespace 'std'
typedef ::std::tuple<T1, T2> ParamType;
~~~~~~~^
/Users/cclient/Work/Source/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h:74:33: warning: 'override' keyword is a C++11 extension
[-Wc++11-extensions]
~CartesianProductGenerator2() override {}
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
119 warnings and 20 errors generated.
make[2]: *** [CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
make[1]: *** [CMakeFiles/gtest.dir/all] Error 2
make: *** [all] Error 2

大量的std错误

查看googletest官方信息

https://github.com/google/googletest/blob/master/googletest/README.md

果然看到
```
C++ Standard Version
An environment that supports C++11 is required in order to successfully build Google Test. One way to ensure this is to specify the standard in the top-level project, for example by using the set(CMAKE_CXX_STANDARD 11) command. If this is not feasible, for example in a C project using Google Test for validation, then it can be specified by adding it to the options for cmake via the DCMAKE_CXX_FLAGS option.

```
更改
vim ../CMakeLists.txt
添加
set(CMAKE_CXX_STANDARD 11)

编译成功

jdeMacBook-Pro:bld cclient$ make
Scanning dependencies of target gtest
[ 25%] Building CXX object CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 50%] Linking CXX static library lib/libgtest.a
[ 50%] Built target gtest
Scanning dependencies of target gtest_main
[ 75%] Building CXX object CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[100%] Linking CXX static library lib/libgtest_main.a

sudo mv libgtest* /usr/lib/ && cd -
#mac 路径 更改至 /usr/local/lib/

sh config_brpc.sh --headers=/usr/local/include --libs=/usr/local/lib --cc=clang --cxx=clang++
gnu-getopt must be installed and used

bjdeMacBook-Pro:brpc cclient$ brew reinstall gnu-getopt
==> Reinstalling gnu-getopt
==> Downloading https://homebrew.bintray.com/bottles/gnu-getopt-1.1.6.high_sierra.bottle.tar.gz
Already downloaded: /Users/cclient/Library/Caches/Homebrew/downloads/bb41269c7b4673c442514e69d159a5ec6238d547266318d72d3c067be2ed448f--gnu-getopt-1.1.6.high_sierra.bottle.tar.gz
==> Pouring gnu-getopt-1.1.6.high_sierra.bottle.tar.gz
==> Caveats
gnu-getopt is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have gnu-getopt first in your PATH run:
echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.bash_profile

==> Summary

尝试brpc来升级rpc服务,测试应用过程的更多相关文章

  1. 以太坊测试网络搭建以及RPC服务开启-配置注意事项

    .Eth QA Test环境: 数据文件路径: C:\Users\Administrator\AppData\Roaming\Ethereum console启动参数: --rpc --testnet ...

  2. 基于开源Dubbo分布式RPC服务框架的部署整合

    一.前言 Dubbo 作为SOA服务化治理方案的核心框架,用于提高业务逻辑的复用.整合.集中管理,具有极高的可靠性(HA)和伸缩性,被应用于阿里巴巴各成员站点,同时在包括JD.当当在内的众多互联网项目 ...

  3. NET Core微服务之路:自己动手实现Rpc服务框架,基于DotEasy.Rpc服务框架的介绍和集成

    本篇内容属于非实用性(拿来即用)介绍,如对框架设计没兴趣的朋友,请略过. 快一个月没有写博文了,最近忙着两件事;    一:阅读刘墉先生的<说话的魅力>,以一种微妙的,你我大家都会经常遇见 ...

  4. 【Rpc】基于开源Dubbo分布式RPC服务框架的部署整合

    一.前言 Dubbo 作为SOA服务化治理方案的核心框架,用于提高业务逻辑的复用.整合.集中管理,具有极高的可靠性(HA)和伸缩性,被应用于阿里巴巴各成员站点,同时在包括JD.当当在内的众多互联网项目 ...

  5. 为什么需要 RPC 服务?

    链接:https://www.jianshu.com/p/362880b635f0 在传统的开发模式中,我们通常将系统的各个服务部署在单台机器,随着服务的扩展,这种方式已经完全无法满足系统大规模的扩展 ...

  6. 基于netty轻量的高性能分布式RPC服务框架forest<下篇>

    基于netty轻量的高性能分布式RPC服务框架forest<上篇> 文章已经简单介绍了forest的快速入门,本文旨在介绍forest用户指南. 基本介绍 Forest是一套基于java开 ...

  7. Thrift 个人实战--Thrift RPC服务框架日志的优化

    前言: Thrift作为Facebook开源的RPC框架, 通过IDL中间语言, 并借助代码生成引擎生成各种主流语言的rpc框架服务端/客户端代码. 不过Thrift的实现, 简单使用离实际生产环境还 ...

  8. 【原创】自己动手实现RPC服务调用框架

    自己动手实现rpc服务调用框架 本文利用java自带的socket编程实现了一个简单的rpc调用框架,由两个工程组成分别名为battercake-provider(服务提供者).battercake- ...

  9. RPC服务和HTTP服务

    很长时间以来都没有怎么好好搞清楚RPC(即Remote Procedure Call,远程过程调用)和HTTP调用的区别,不都是写一个服务然后在客户端调用么?这里请允许我迷之一笑~Naive!本文简单 ...

随机推荐

  1. hibernate中save、update、saveOrUpdate的区别

    saveOrUpdate如果hibernate-mapping配置的主键已存在,就不会新增,会更新. ------------------------------------------------- ...

  2. linux提交代码到github

    1.首先你得注册个github账户 .... 2.新建项目(可以选择私有或者公开的) 3.上述github代码仓库建立好了 ,就回到自己的linux服务器 3.1  在自己的项目目录里 qi 3.1. ...

  3. POJ-3629 模拟

    A - Card Stacking Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u S ...

  4. gentoo 修改键盘映射

    gentoo 上面修改键盘映射分为两种,一种是终端环境,一种是X环境. 终端环境 https://www.emacswiki.org/emacs/MovingTheCtrlKey https://wi ...

  5. bugku-杂项 convert

    打开题目文件,一大堆01码,用py转换成hex f=open("in.txt","r") print hex(int(str(f.read()),2)) f.c ...

  6. (7)opencv图片内部的基本处理

    就是,给定我们一张图片,我们可以对图片的每一个像素的色彩进行处理 比如,我们的原图是这个样子 然后我首先将他变成灰度图(灰度图的行道是1,就是chanaual是1) 然后,我又将灰色图片的黑白进行颠倒 ...

  7. xv6的启动过程

    bootloader 1. bootasm.S : start32 2. bootmain.c : bootmain kernel 3. main.c : main 4. proc.c : useri ...

  8. delphi 文本 记录 流式 读写文件

    unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System ...

  9. 零基础程序员入门Linux系统 !如何快速恢复系统?

    新手在学习Linux系统的时候,难免会遇到命令输错,或系统出错的难题.那么如何快速解决呢?本文就先给你一个后悔药,让你快速备份并恢复Linux系统.本文将以Ubuntu为例,在这之前,你需要一台服务器 ...

  10. 最大连续子序列和,以及开始、结束下标(HDU 1003)

    HDU1003 Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the ...