尝试使用pkg-config,但它不是一个已注册的命令。

huangapple go评论83阅读模式
英文:

Trying to use pkg-config but it not being a registered command

问题

好的,我已经在Windows 8下搭建好了整个Go开发环境,还安装了MinGW。我正在使用LiteIde

C:/Go/bin/go.exe build [C:/Users/Alyx/Go/Hi]
pkg-config --cflags sdl
exec: "pkg-config": 可执行文件在%PATH%中未找到
错误:进程以代码2退出。

但是然后我遇到了一个关于"pkg-config"的错误,起初我没有安装它。(我正在尝试编译带有列出全屏模式的测试的SDL绑定)

然后我将它全部设置在了C:\MinGW\Bin文件夹中(pkg-config.exe和额外的dll文件)。

但是然后它仍然无法工作。进入CMD中输入它的名称,显示"不被识别为内部命令..."。

所以我想我必须需要在Windows中设置一个环境变量。我尝试了%PATH%并设置为"C:\MinGW\bin"的值。没有效果。然后我尝试了PKG_CONFIG_PATH。还是没有效果。

所以我不确定我需要什么环境变量,或者是否有任何可以放入LiteIde中的变量。除此之外,我不知道还能做什么。

英文:

Ok so I've got my whole Go development environment up under Windows 8, also with MinGW. I'm using the LiteIde.

C:/Go/bin/go.exe build  [C:/Users/Alyx/Go/Hi]
pkg-config --cflags sdl
exec: "pkg-config": executable file not found in %PATH%
Error: process exited with code 2.

But then I get an error for "pkg-config" which at first I didn't have installed. (I'm trying to compile the SDL binding with a test that lists the fullscreen modes)

Then I got it all set up in the C:\MinGW\Bin folder (pkg-config.exe and the extra dll's).

But then it still wouldn't work. Went into CMD typed in its name "not recognized as internal..."

So then I figured I must need to put an environment variable into Windows. I tried %PATH% with the "C:\MinGW\bin" value. Nothing. Then I tried PKG_CONFIG_PATH. Nothing.

So I'm not sure what Environment Variable I need, or if there is any sort of variable I can put into LiteIde. Other than that idk what else to do.

答案1

得分: 1

从错误信息来看,你尝试将C:\MinGW\bin添加到%PATH%变量中似乎没有成功。

请确保你将其添加到“控制面板\所有控制面板项\系统”下的系统环境变量中,点击“高级系统设置”,选择“高级”选项卡,点击“环境变量…”按钮,然后编辑“系统变量”下的“Path”条目(在现有值的末尾添加;C:\MinGW\bin)。然后重新启动你的命令行或者集成开发环境以应用系统设置。

如果pkg-config.exeC:\MinGW\bin文件夹中,它将会在%PATH%中找到。

英文:

From the error, it sounds like your attempt to add C:\MinGW\bin to the %PATH% variable was unsuccessful.

Make sure you're adding it to the System Environment Variables under Control Panel\All Control Panel Items\System, Click on Advanced System Settings, Advanced tab, Environment Variables... button and edit the Path entry under System variables (Add ;C:\MinGW\bin to the end of the existing value). Then restart your shell or IDE to apply the system settings.

If pkg-config.exe is in the C:\MinGW\bin folder it will be found in %PATH%.

huangapple
  • 本文由 发表于 2013年7月16日 18:49:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/17674600.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定