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