zoukankan      html  css  js  c++  java
  • 如何让thrift0.9.2 在macos上面编译通过?

    为将来跨语言通信预研,选择了thrift来试试。结果在mac os上面安装遇到种种困难,不知道是我选择方法错误还是咋的,不管怎样,总算是编译过去了。

    首先,我们来参考官网的安装步骤:https://thrift.apache.org/docs/install/os_x

    OS X Setup

    The following command install all the required tools and libraries to build and install the Apache Thrift compiler on a OS X based system.

    Install Boost

    Download the boost library from boost.org untar compile with

    ./bootstrap.sh
    sudo ./b2 threading=multi address-model=64 variant=release stage install
    

    Install libevent

    Download libevent, untar and compile with

    ./configure --prefix=/usr/local 
    make
    sudo make install
    

    Building Apache Thrift

    Download the latest version of Apache Thrift, untar and compile with

    ./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local
    

    Additional reading

    For more information on the requirements see: Apache Thrift Requirements

    For more information on building and installing Thrift see: Building from source

    ----------------------------------------------------------------------------------

    然后,你可能会遇到下面的问题:

    make[4]: *** [src/thrift/transport/TSSLSocket.lo] Error 1

    openssl版本过旧导致, 在mac下面可以升级一下:

    brew update
    brew install openssl
    brew link --force openssl

    openssl version -a

    processor/ProcessorTest.cpp:26:10: fatal error: 'tr1/functional' file not found

    The problem here is that libc++ has been written after c++11 was "released".
    You could try this:

    #if __cplusplus >= 201103L
    #include <functional>
    #else
    #include <tr1/functional>
    #endif

    and compile with CXXFLAGS="-std=c++11".

    [thrift dir]/lib/cpp/test/processor/ProcessorTest.cpp 

    ---------------------------------------------------------------------

    library not found for -l:libboost_unit_test_framework.a thrift

    为啥不能找到lib目录呢?

    fuck,修改:

    vim  [thrift dir]/lib/cpp/test/Makefile.am 

    暂时用绝对路径:/usr/local/lib/ibboost_unit_test_framework.a 替换

    终于通过了,跨平台为啥做的这么烂~

     

  • 相关阅读:
    iOS6 与iOS7以及7以上状态栏的颜色设置
    XCode常用快捷键的使用
    [Cordova+Sencha Touch] 移动开发1 sencha 2.4.0 + 在 安卓2.3.6上使用报错
    document.addEventListener的使用介绍
    设置aspx页面的地址栏中的Session ID的显示与隐藏
    Android检测网络是否可用并获取网络类型
    程序员必读书籍及导读指南
    ListView的属性及方法详解
    javascript
    CSS
  • 原文地址:https://www.cnblogs.com/zhangqingping/p/4452990.html
Copyright © 2011-2022 走看看