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

Alyx picture Alyx · Jul 16, 2013 · Viewed 10.5k times · Source

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.

Answer

Intermernet picture Intermernet · Jul 16, 2013

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%.