错误:未满足包要求(libprotobuf-c> = 1.0.1)

问题描述 投票:1回答:1

我正在使用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

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

linux protocol-buffers embedded-linux autoconf pkg-config
1个回答
0
投票

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

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

Ubuntu的软件包是:

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

Fedora的软件包是:

  • protobuf的-devel的
  • 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/

安装了prereq后,您应该使用以下摘要成功配置:

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
© www.soinside.com 2019 - 2024. All rights reserved.