【问题标题】:Error: Package requirements (libprotobuf-c >= 1.0.1) were not met错误:未满足包要求(libprotobuf-c >= 1.0.1)
【发布时间】:2019-09-15 03:02:29
【问题描述】:

我正在使用来自 GitHub 的 protobuf-c。当我运行 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

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

【问题讨论】:

  • 您的意思是当您尝试配置 protobuf-c 本身时,或者当您尝试配置使用 protobuf-c 的其他项目时遇到该错误?
  • 当我尝试编译 protobuf-c 本身时得到它
  • 嗯,您提供的错误消息似乎表明问题在于您说您正在尝试构建的包不存在。可能是 protobuf-c 的构建系统非常损坏,产生了这样的问题,但我在 Autoconf 源代码中没有看到任何支持该主张的内容。然后,请提供一个可以重现问题的分步过程。

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


【解决方案1】:

如何解决有关 libprotobuf-c 的配置错误?
配置:错误:未满足包要求(libprotobuf-c >= 1.0.1)...

确保您已安装这些先决条件。 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/

安装 prereqs 后,您应该成功配置如下摘要:

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

【讨论】:

  • 非常感谢您的回答!!我安装了 libprotobuf-dev 和 libprotoc-dev 但我没有安装 protobuf-compiler 我不知道为什么当我运行 sudo apt-get install protobuf-compiler 时它说“不可能找到数据包”,libprotobuf-c 错误也是总是在那里我试图导出 pkgconfig 路径但它没用,除了你提到的之外,可能是什么原因? ps:我使用的是ubuntu 14.04 谢谢。
  • apt-cache search protobuf.
猜你喜欢
  • 2020-04-02
  • 1970-01-01
  • 2020-09-21
  • 1970-01-01
  • 1970-01-01
  • 2022-11-10
  • 2016-12-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多