protoc支持c_安装protobuf-c执行./configure时遇到的问题解决办法

在安装protobuf-c 1.1.1时,由于protobuf版本要求为2.6.0+,在执行configure时遇到找不到protobuf库的错误。问题在于pkg_config_path未指向protobuf的库文件路径。解决方案是设置环境变量PKG_CONFIG_PATH为/usr/local/lib/pkgconfig,然后重新运行configure和make,成功安装后,使用protoc-c编译test.proto文件无误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题报错:

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

No package 'protobuf' 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 protobuf_CFLAGS

and protobuf_LIBS to avoid the need to call pkg-config.

See the pkg-config man page for more details.

(1)问题出现:

安装protobuf-c是,我们需要首先安装protobuf, 此外还需要通过protobuf-c对 之前安装的protobuf的版本认证。 我们当前开发所使用的是

protobuf2.6.0  以及protobuf-c 1.1.1 。

protobuf-c 1.1.1  Package requirements (protobuf >= 2.6.0)

Proctobuf安装步骤

tar zxvf

protobuf-2.3.0.tar.gz

cd protobuf-2.4.1

./configure --prefix=/usr/local

make

sudo make install

在/etc/ld.so.conf 中添加一行: /usr/local/lib,保存退出

/sbin/ldconfig -v

Proctobuf-c安装步骤,版本要一直,前提:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值