在Windows中使用pkg config查找库

在Windows中使用pkg config查找库,windows,waf,pkg-config,Windows,Waf,Pkg Config,我正在尝试使用pkg config在windows(msvc)中查找gstreamer库 pkg config gstreamer-0.10--cflags--libs 但是我得到了这样的结果 Package gstreamer-0.10 was not found in the pkg-config search path. Perhaps you should add the directory containing `gstreamer-0.10.pc' to the PKG_CONFIG

我正在尝试使用pkg config在windows(msvc)中查找gstreamer库

pkg config gstreamer-0.10--cflags--libs

但是我得到了这样的结果

Package gstreamer-0.10 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-0.10.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gstreamer-0.10' found
类.pc是在安装库时创建的(通过使用RPM、deb或其他二进制打包系统或从源代码处编译自动创建)。我在我的gstreamer目录中找不到.pc文件

我应该创建一个包含所有必要细节的.pc文件吗

prefix=C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.7
exec_prefix=${prefix}
libdir=${exec_prefix}\lib
includedir=${prefix}\sdk\include\gstreamer-0.10
toolsdir=${exec_prefix}\bin
pluginsdir=${exec_prefix}\lib\gstreamer-0.10
datarootdir=${prefix}\share
datadir=${datarootdir}
girdir=${datadir}/gir-1.0
typelibdir=${libdir}/girepository-1.0

Name: GStreamer
Description: Streaming media framework
Requires: glib-2.0, gobject-2.0, gmodule-no-export-2.0, gthread-2.0, libxml-2.0
Version: 0.10.35
Libs: -L${libdir} -lgstreamer-0.10
Cflags: -I${includedir}
或者有其他方法可以做到这一点,或者我错过了什么

希望你能帮忙。谢谢你花时间阅读这个问题

我这样做是为了找到解决方案,为什么在我的waf configure for gstreamer中会收到
not found
消息

conf.check_cfg(atleast_pkgconfig_version='0.0.0') 
conf.check_cfg(package='gstreamer-0.10', uselib_store='GSTREAMER', args='--cflags --libs', mandatory=True)
该代码可以在linux中运行,也可以在windows中运行


以后添加

制作.pc并将.pc dir的路径设置为PKG_CONFIG_path环境变量就可以了


退房。感谢阅读并帮助我:)

pkg config是一个很好的工具,但不幸的是在Windows(与UNIX相比)上没有标准的可执行路径或pkg_config_路径

虽然您可以恢复到定义选项--使用gstreamer include dir--使用gstreamer lib dir。。。为了避免pkg-config依赖关系,还可以使用--pkgconfig exe c:\path\to\pkg-config.exe--pkgconfig path c:\path\to\gstreamer;c:\path\to\otherlib,这将有助于拥有一个好看的wscript,尤其是在使用大量pkg config lib时

典型的Win32用户可能会遇到直接设置PKG_CONFIG_路径和路径的问题,或者遇到一个神秘的“未找到”错误,然后检查CONFIG.log

如果您确实添加了windows特定的pkg配置选项,那么大家可能都会感兴趣。
您可以编写一个pkgconfig_opts工具,并将其作为waf额外文件提交。

这很简单。我只想知道如何使用pkconfig在windows中查找某些库。那么,它是否已安装?明格还是赛金?它安装在哪里?请尝试
configure--help
@sehe感谢您的回复。pk config已安装并正常工作。我在环境中添加了一个变量PKG_CONFIG_PATH,并在路径dir中创建了一些名为gstreamer-0.10.pc的.pc文件。您是如何安装gstreamer的?PKG_CONFIG只有在Unixy安装过程完成时才有意义done@Mark我遵从了src的gstreamer。嗯,我没有找到任何其他方法,我不得不为它制作pc文件。:(…但它工作正常:)