简体   繁体   English

Cygwin pkg-config / protobuf文件路径问题

[英]Cygwin pkg-config/protobuf filepath issues

I'm trying to compile & install a C++ library using Cygwin. 我正在尝试使用Cygwin编译和安装C ++库。 I've properly installed the library's dependencies. 我已经正确安装了库的依赖项。 However, ./configure is throwing an error: 但是,。/ configure引发错误:

checking for protobuf... no configure: error: Package requirements (protobuf >= 3.3) were not met: 正在检查protobuf ...否配置:错误:不满足软件包要求(protobuf> = 3.3):

No package 'protobuf' found 找不到软件包“ protobuf”

Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. 如果您以非标准前缀安装软件,请考虑调整PKG_CONFIG_PATH环境变量。

I then checked config.log, and found a suggestion to point PKG_CONFIG_PATH at the lib/pkgconfig directory. 然后,我检查了config.log,并发现了将PKG_CONFIG_PATH指向lib/pkgconfig目录的建议。 I promptly set PKG_CONFIG_PATH to /usr/local/lib/pkgconfig , the directory where protobuf.pc is located on my system. 我立即将PKG_CONFIG_PATH设置为/usr/local/lib/pkgconfig ,即protobuf.pc在系统上的目录。 The error persisted. 错误仍然存​​在。 Some checking of similar questions here showed that some people had to use the Windows filepath, so I switched PKG_CONFIG_PATH to c:\\\\cygwin64\\\\usr\\\\local\\\\lib\\\\pkgconfig . 在这里对类似问题的一些检查表明,有些人必须使用Windows文件路径,因此我将PKG_CONFIG_PATH切换为c:\\\\cygwin64\\\\usr\\\\local\\\\lib\\\\pkgconfig The error persisted. 错误仍然存​​在。 I even tried setting PKG_CONFIG_PATH to /cygdrive/c/cygwin64/usr/local/lib/pkgconfig . 我什至尝试将PKG_CONFIG_PATH设置为/cygdrive/c/cygwin64/usr/local/lib/pkgconfig Which didn't work. 哪个没有用。

What am I doing wrong here? 我在这里做错了什么?

(Since I can't comment yet, I guess I need to leave this as an answer?) (由于我无法发表评论,我想我需要将此作为答案吗?)

After installing the libprotobuf-devel package from the cygwin setup.exe, I could run pkg-config --list-all and see protobuf listed in the output. 从cygwin setup.exe安装libprotobuf-devel软件包后,我可以运行pkg-config --list-all并在输出中看到protobuf Also, pkg-config --print-provides protobuf returns protobuf = 3.3.1 . 同样, pkg-config --print-provides protobuf返回protobuf = 3.3.1 Are you getting the same output? 您得到相同的输出吗?

I would also look at the configure script to see what it's trying to check. 我还将查看configure脚本,以查看其要检查的内容。 Opening up configure and searching for protobuf or checking for protobuf should get you close to the actual check. 打开configure并搜索protobufchecking for protobuf应该可以使您接近实际检查。 Maybe configure is trying to do something weird. 也许configure正在尝试做一些奇怪的事情。

Lastly, at least on my cygwin install, I do not have a /usr/local/lib/pkgconfig directory. 最后,至少在我的cygwin安装中,我没有/usr/local/lib/pkgconfig目录。 If you installed protobuf from source, maybe you could try the cygwin devel package (libprotobuf-devel) and see if that helps. 如果您从源代码安装了protobuf,也许您可​​以尝试使用cygwin devel软件包(libprotobuf-devel),看看是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM