root用户/protobuf安装参考http://blog.csdn.net/tdmyl/article/details/31811317
安装包也可以联系1365728210@qq.com
$./configure
$make&&make install报错如下:(prefix默认为/usr/local/)
test -z "/usr/local/lib/pkgconfig" || /usr/bin/mkdir -p "/usr/local/lib/pkgconfig"
/usr/bin/install: cannot create regular file ‘/usr/local/lib/pkgconfig/protobuf.pc’: Permission denied
/usr/bin/install: cannot create regular file ‘/usr/local/lib/pkgconfig/protobuf-lite.pc’: Permission denied
非管理员用户,没有权限对/usr进行修改。
所以自定义编译的输出目录为/user4/zsun/usr/
$./configure --prefix=/users4/zsun/usr/
$make&&make install报错如下:
test -z "/users4/zsun/usr/lib/pkgconfig" || /usr/bin/mkdir -p "/users4/zsun/usr/lib/pkgconfig"/usr/bin/mkdir: cannot create directory ‘/users4’: Permission denied
手动建立/users4/zsun/usr/lib/pkgconfig文件夹
重新make install报错:
libtool: install: error: cannot install `libprotoc.la' to a directory not ending in /home/XXXX
问题参考http://blog.csdn.net/qq_25147897/article/details/78544395解决。
$make clean
$make
$make install 成功
$export PATH=/users4/zsun/usr/bin:$PATH
$protoc --version查看版本
成功