我正在安装protobuf-c 1.3.2
在./配置后显示
protobuf-c 1.3.2
CC: gcc
CFLAGS: -g -O2
CXX: g++ -std=c++11
CXXFLAGS: -g -O2
LDFLAGS:
LIBS:
prefix: /usr/local
sysconfdir: ${prefix}/etc
libdir: ${exec_prefix}/lib
includedir: ${prefix}/include
pkgconfigdir: ${libdir}/pkgconfig
bigendian: no
protobuf version: libprotoc 3.8.0但是pkg-config --cflags 'libprotobuf >= 1.0.0'不起作用。上面写着
Package libprotobuf was not found in the pkg-config search path.
Perhaps you should add the directory containing `libprotobuf.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libprotobuf' foundpkg-config --variable pc_path pkg-config显示
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig发布于 2019-07-08 12:02:50
为什么要从源构建protobuf-c Ubuntu存储库包?更喜欢使用apt安装Ubuntu存储库包,而不是下载和编译它们,这是一个很好的实践,也更方便。如果使用apt安装,当更新可用时,protobuf-c会自动更新。因此,您可以看到,用apt和apt两种方式安装它更安全。
要在所有当前支持的Ubuntu版本中安装协议缓冲区C编译器(protobuf-c),请打开终端并键入:
sudo apt install protobuf-c-compiler 在Ubuntu18.04中,此命令安装protobuf-c的1.2.1版本,在Ubuntu 19.04中安装1.3.1版本。
协议缓冲区是一种灵活、高效、自动化的序列化结构化数据的机制--类似于XML,但更小、更快和更简单。您可以定义您希望您的数据被构造一次的方式,然后您可以使用特殊生成的源代码来轻松地从各种数据流和使用各种语言来编写和读取您的结构化数据。您甚至可以更新您的数据结构,而不破坏根据“旧”格式编译的已部署程序。
发布于 2019-07-09 06:17:56
make install显示
make install-am
make[1]: Entering directory '/home/lohit/Documents/practise/protobuf-c'
make[2]: Entering directory '/home/lohit/Documents/practise/protobuf-c'
/bin/mkdir -p '/usr/local/lib'
/bin/bash ./libtool --mode=install /usr/bin/install -c protobuf-c/libprotobuf-c.la '/usr/local/lib'
libtool: install: /usr/bin/install -c protobuf-c/.libs/libprotobuf-c.so.1.0.0 /usr/local/lib/libprotobuf-c.so.1.0.0
/usr/bin/install: cannot remove '/usr/local/lib/libprotobuf-c.so.1.0.0': Permission denied
make[2]: *** [Makefile:1103: install-libLTLIBRARIES] Error 1
make[2]: Leaving directory '/home/lohit/Documents/practise/protobuf-c'
make[1]: *** [Makefile:2192: install-am] Error 2
make[1]: Leaving directory '/home/lohit/Documents/practise/protobuf-c'
make: *** [Makefile:2186: install] Error 2没有访问路径的权限。make uninstall && sudo make install成功了。
https://askubuntu.com/questions/1156706
复制相似问题