mac安裝protobuf2.4.1時報錯./include/gtest/internal/gtest-port.h:428:10: fatal error: 'tr1/tuple' file not found和google/protobuf/message.cc:175:16: error: implicit instantiation of undefined template


通過網上下載的protobuf2.4.1的壓縮文件,然后進行安裝,./configure和make時遇到了兩個問題。
正常的安裝步驟如下:
./configure
make 
make check
make install
protoc —version
 
問題一
protobuf2.4.1通過下載的tar.gz文件安裝時./configure報錯:./include/gtest/internal/gtest-port.h:428:10: fatal error: 'tr1/tuple' file not found
 
解決方法
進入解壓后的protobuf2.4.1目錄,輸入命令【./autogen.sh】生成configure文件
 
然后輸入以下命令進行安裝
./configure
make 
make check
make install
 
問題二
安裝到make步驟時報錯:google/protobuf/message.cc:175:16: error: implicit instantiation of undefined template
 
解決方法
編輯目錄下的文件./src/google/protobuf/message.cc,添加頭文件#include <istream>,問題解決,繼續下面的安裝步驟即可
 
 
備注
從git上下載protobuf2.4.1非常慢,然后再微盤上找到了一個下載資源http://vdisk.weibo.com/s/tYlk6JrNUYTY
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM