如何在 Windows 中安装 pkg 配置?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1710922/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 06:53:53  来源:igfitidea点击:

How to install pkg config in windows?

windowspkg-config

提问by devoured elysium

I am trying to do it, but all I can get is some source code that I don't know how to do deal with I downloaded from http://pkgconfig.freedesktop.org/releases/.

我正在尝试这样做,但我只能得到一些源代码,我不知道如何处理我从http://pkgconfig.freedesktop.org/releases/下载的。

Any help?

有什么帮助吗?

回答by HyperQuantum

This is a step-by-step procedure to get pkg-config working on Windows, based on my experience, using the info from Oliver Zendel's comment.

这是根据我的经验,使用 Oliver Zendel 评论中的信息,让 pkg-config 在 Windows 上运行的分步过程。

I assume here that MinGW was installed to C:\MinGW. There were multiple versions of the packages available, and in each case I just downloaded the latest version.

我在这里假设 MinGW 安装到 C:\MinGW。有多个版本的软件包可用,在每种情况下,我都只下载了最新版本。

  1. go to http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
  2. download the file pkg-config_0.26-1_win32.zip
  3. extract the file bin/pkg-config.exe to C:\MinGW\bin
  4. download the file gettext-runtime_0.18.1.1-2_win32.zip
  5. extract the file bin/intl.dll to C:\MinGW\bin
  6. go to http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28
  7. download the file glib_2.28.8-1_win32.zip
  8. extract the file bin/libglib-2.0-0.dll to C:\MinGW\bin
  1. http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
  2. 下载文件pkg-config_0.26-1_win32.zip
  3. 将文件 bin/pkg-config.exe 解压到 C:\MinGW\bin
  4. 下载文件gettext-runtime_0.18.1.1-2_win32.zip
  5. 将文件 bin/intl.dll 解压到 C:\MinGW\bin
  6. 转到http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28
  7. 下载文件glib_2.28.8-1_win32.zip
  8. 将文件 bin/libglib-2.0-0.dll 解压到 C:\MinGW\bin

Now CMake will be able to use pkg-config if it is configured to use MinGW.

现在,如果 CMake 配置为使用 MinGW,它将能够使用 pkg-config。

回答by mpromonet

A alternative without glib dependency is pkg-config-lite.

不依赖 glib 的替代方案是pkg-config-lite

Extract pkg-config.exefrom the archive and put it in your path.

pkg-config.exe从存档中提取并将其放入您的路径中。

Nowdays this package is available using chocolatey, then it could be installed whith

现在这个包可以使用Chocolatey,然后它可以安装

choco install pkgconfiglite

回答by Dzintars

I did this by installing Cygwin64from this link https://www.cygwin.com/Then - Wiew Full, Search gccand scroll down to find pkg-config. Click on icon to select latest version. This worked for me well.

我通过从此链接安装Cygwin64来做到这一点https://www.cygwin.com/然后 - Wiew Full,搜索gcc并向下滚动以找到pkg-config。单击图标选择最新版本。这对我很有效。

回答by olippuner

for w64-based computers you have to install mingw64. If pkg-config.exe is missing then, you can refer to http://ftp.acc.umu.se/pub/gnome/binaries/win64/dependencies/

对于基于 w64 的计算机,您必须安装 mingw64。如果缺少 pkg-config.exe,可以参考http://ftp.acc.umu.se/pub/gnome/binaries/win64/dependencies/

Unzip and copy/merge pkg-config.exe into your C:\mingw-w64 installation, eg. into on my pc into C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin

解压缩并将 pkg-config.exe 复制/合并到您的 C:\mingw-w64 安装中,例如。在我的电脑上进入 C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin

回答by metator

Another place where you can get more updated binaries can be found at Fedora Build System site. Direct link to mingw-pkg-config package is: http://koji.fedoraproject.org/koji/buildinfo?buildID=354619

另一个可以获得更多更新二进制文件的地方可以在 Fedora Build System 站点上找到。mingw-pkg-config 包的直接链接是:http://koji.fedoraproject.org/koji/buildinfo?buildID= 354619