国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 建站經驗 > 正文

thrift安裝遇到的問題以及解決方法(必看篇)

2019-11-02 16:43:55
字體:
來源:轉載
供稿:網友

1. 必須安裝boost。最新的穩定版是1.48.0。

1.1.先下載:http://sourceforge.NET/projects/boost/files/boost/1.48.0/
    
    選擇tar.gz包,
    下載后我解壓到了/usr/local/boost_1_48下:tar zxvf boost1.48.0 -C /usr/local/boost_1_48

1.2.安裝過程和以前的老版本有些不同,看自帶軟件包里的index.html就可以了:

    主要內容涉及到安裝的就2步,很簡單,進入一級目錄:
   
    $ ./bootstrap.sh //默認安裝到/usr/local/include/boost 和/usr/local/lib下
    $ ./b2 install

1.3接下來設置環境變量自動導入:
   
   先用vim創建文件:/etc/profile.d/boost.sh,(若不能執行的話使用chmod a+x boost.sh設置執行權限),
  
   內容為:

#!/bin/sh #boost settings BOOST_ROOT=/opt/boost_1_48 BOOST_INCLUDE=/usr/local/include/boost BOOST_LIB=/usr/local/lib export BOOST_ROOT BOOST_INCLUDE BOOST_LIB 注意: linux程序運行時加載共享庫出現的錯誤: "error while loading shared libraries: xxxx: cannot open shared object file: No such file or directory" 解決步驟: 1、使用find命令查找缺失的xxxx共享庫文件所在位置。參考:#find 目錄 -name "xxxx*" 2、將找到的目錄位置寫入 /etc/ld.so.conf 配置文件,這個文件記錄了編譯時使用的動態鏈接庫的路徑。 3、然后使用ldconfig命令,使配置生效。

2. 安裝libevent(選擇noblokingserver必須安裝libevent,如果出現noblokingserver相關的錯誤就是沒有安裝libevent)。

我安裝的版本是最新的libevent1.4.13:

wget http://monkey.org/~provos/libevent-1.4.13-stable.tar.gztar xvzf libevent-1.4.13-stable.tar.gzcd libevent-1.4.13-stable./configure && makemake install

3. 接下來就是安裝thrift,我下載的是最新的thrift0.8.0版本,進入thrift0.8.0目錄:

 因為我只需要編譯cpp,用以下命令:(編譯選項可以參考http://www.coder4.com/archives/2110):

./configure --with-cpp --with-boost --without-python --without-csharp --without-java --without-erlang --without-perl --without-php --without-php_extension --without-ruby --without-haskell --without-go #makemake #installmake install

如果還需要編譯Java或者別的語言,還需要提前安裝別的包,具體參考http://wiki.apache.org/thrift/ThriftRequirements:

C++Boost 1.33.1+libevent (optional, to build the nonblocking server)zlib (optional)JavaJava 1.5+Apache AntApache Ivy (recommended)Apache Commons Lang (recommended)SLF4JC#: Mono 1.2.4+ (and pkg-config to detect it) or Visual Studio 2005+Python 2.4+ (including header files for extension modules)PHP 5.0+ (optionally including header files for extension modules)Ruby 1.8+ (including header files for extension modules)Erlang R12 (R11 works but not recommended)Perl 5Bit::VectorClass::Accessor

安裝完thrift先試驗一下。進入thrift下的tutorial,編譯給出的例子:

thrift -r --gen cpp tutorial.thrift,

會在gen-cpp目錄下生成一些文件。然后進入CPP目錄,進行編譯:

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 蒙城县| 五峰| 邵阳县| 喀什市| 上饶市| 中江县| 克拉玛依市| 慈利县| 蒙阴县| 阿城市| 呈贡县| 武川县| 五华县| 祥云县| 肥西县| 双桥区| 南投县| 南汇区| 永新县| 梅河口市| 新蔡县| 莱州市| 太仆寺旗| 民县| 冀州市| 礼泉县| 微山县| 大连市| 曲水县| 林口县| 阿勒泰市| 崇明县| 睢宁县| 抚松县| 辽阳县| 宽甸| 滁州市| 延安市| 保德县| 高台县| 南阳市|