linux - 错误 : Package requirements (libprotobuf-c >= 1. 0.1) 未满足

标签 linux protocol-buffers embedded-linux autoconf pkg-config

我正在使用 protobuf-c来自 GitHub。当我运行 make 时发生此错误。

$ git clone https://github.com/protobuf-c/protobuf-c.git
Cloning into 'protobuf-c'...
$ cd protobuf-c
$ ./autogen.sh
...

然后:

$ ./configure
...

checking whether g++ supports C++11 features with -std=c++11... yes
checking for protobuf... no
checking for protobuf... no
configure: error: Package requirements (libprotobuf-c >= 1.0.1) were not met:
No package 'libprotobuf-c' found

Consider adjusting the `PKG_CONFIG_PATH` environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables `libprotobuf_c_CFLAGS`
and `libprotobuf_c_LIBS` to avoid the need to call pkg-config.
See the pkg-config man page for more details.
make: *** [config.status] Erreur 1

问题是什么,我该如何解决?

最佳答案

How can i fix this configure error about libprotobuf-c?
configure: error: Package requirements (libprotobuf-c >= 1.0.1) were not met...

确保您已安装这些先决条件。 README.md 没有列出它们。

Ubuntu 的软件包是:

  • libprotobuf-dev
  • libprotoc-dev
  • protobuf 编译器

Fedora 的软件包是:

  • protobuf 开发
  • protobuf 编译器

如果您缺少 libprotobuf-dev,则会收到错误:

configure: error: Package requirements (protobuf >= 2.6.0) were not met...

如果您缺少 libprotoc-dev,则会收到错误:

checking for google/protobuf/compiler/command_line_interface.h:
configure: error: required protobuf header file not found

如果您缺少 protobuf-compiler,则会出现错误:

configure: error: Please install the protobuf compiler from
https://code.google.com/p/protobuf/

安装了先决条件后,您应该成功配置了如下摘要:

configure: creating ./config.status
config.status: creating Makefile
config.status: creating protobuf-c/libprotobuf-c.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

protobuf-c 1.3.1

    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.0.0

关于linux - 错误 : Package requirements (libprotobuf-c >= 1. 0.1) 未满足,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55853361/

相关文章:

regex - apache SetEnvIf Request_URI 无法正常工作

golang + grpc : register a service on GrpcServer

c++ - 哪些库必须与 Protocol Buffer 生成的 C++ 代码链接

python - ImportError : No module named google. protobuf

linux - IRQ7 上的并行端口 IRQ 处理程序注册

c - 如何在不关闭套接字的情况下向主机发送 FIN 标志

linux - 在具有两个分隔符的文件中搜索值

linux - "Argument list too long"显示所有列表元素

linux - 具有 8 个 channel 的 ALSA 捕获流,但打开流为 4

linux - 什么是 dbus 守护进程以及为什么 vlc 需要它