Tuesday, July 14, 2009

MinGW: Getting Pkg-Config When Building Glib For the First Time

If you're building glib for Windows for the first time but don't have pkg-config, there are a few ways to get pkg-config. Because pkg-config depends on glib, there is an inter-dependency problem between pkg-config and glib. One way to address this problem is to get Cygwin-built pkg-config. I recommend getting a Cygwin build, pkg-config-0.23b-1.tar.bz2 and cygwin-1.5.25-15.tar.bz2. Then, extract pkg-config.exe and cygwin1.dll like this:



tar xjOf pkg-config-0.23b-1.tar.bz2 usr/bin/pkg-config.exe > /mingw/bin/pkg-config.exe
tar xjOf cygwin-1.5.25-15.tar.bz2 usr/bin/cygwin1.dll > /mingw/bin/cygwin1.dll


If pkg-config can't find a library during configure, set the environment variable PKG_CONFIG_PATH.



PKG_CONFIG_PATH="C:\MinGW\lib\pkgconfig"
export PKG_CONGIG_PATH


Check: pkg-config --help

    pkg-config --libs --cflags glib-2.0

No comments:

Post a Comment

About This Blog

KBlog logo This blog seeks to provide a collection of interesting pictures found on the Web. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

Powered By Blogger