Centos7.3中怎么編譯安裝grpc

這期內(nèi)容當(dāng)中小編將會給大家?guī)碛嘘P(guān)Centos7.3中怎么編譯安裝grpc,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

成都創(chuàng)新互聯(lián)公司堅持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:網(wǎng)站設(shè)計制作、網(wǎng)站設(shè)計、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時代的晉寧網(wǎng)站設(shè)計、移動媒體設(shè)計的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!

相關(guān)工具

yum install -y gcc gcc-c++ autoconf libtool
yum groupinstall -y "Development Tools"

下載源碼

git clone https://github.com/grpc/grpc.git
cd grpc
git submodule update --init

編譯安裝protobuf

cd third_party/protobuf/
./autogen.sh
./configure
make
make install
ldconfig # refresh shared library cache.
which protoc
protoc --version

autogen.sh里需要下載Google Code的代碼,需要保障其能被訪問

編譯安裝grpc

cd ../..
make

問題:

/root/git/grpc/bins/opt/grpc_cpp_plugin: error while loading shared libraries: libprotoc.so.15: cannot open shared object file: No such file or directory

解決辦法:

echo $LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib/:/root/git/grpc/libs/opt/
make
make install

測試C++ Demo

cd examples/cpp/helloworld
make

問題:

Package protobuf was not found in the pkg-config search path.
Perhaps you should add the directory containing `protobuf.pc'
to the PKG_CONFIG_PATH environment variable
No package 'protobuf' found

解決辦法:

echo $PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/root/git/grpc/libs/opt/pkgconfig:/root/git/grpc/third_party/protobuf
make
./greeter_server &
./greeter_client

上述就是小編為大家分享的Centos7.3中怎么編譯安裝grpc了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

當(dāng)前標(biāo)題:Centos7.3中怎么編譯安裝grpc
路徑分享:http://muchs.cn/article38/iidcpp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設(shè)網(wǎng)站設(shè)計、網(wǎng)站內(nèi)鏈、靜態(tài)網(wǎng)站、建站公司、App開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司