Package glib-2.0 not found in pkg-config search path

Diogo Brito diogowbrito at gmail.com
Mon Oct 1 01:49:53 PDT 2012


Hello,

I've successfully installed glib2 trough MacPorts but can't still compile
my program.

Installed, as seen:

sudo port install glib2
--->  Computing dependencies for glib2
--->  Cleaning glib2
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

sudo port install pkgconfig
--->  Cleaning pkgconfig
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

And compiling...

eg:

gcc -o main main.c `pkg-config --libs --cflags glib-2.0`
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
main.c:17:18: error: glib.h: No such file or directory

I tried, as the error says, to add the glib2 to PKG_CONFIG_PATH but wasn't
able to find it in /opt/local/bin

The only folders found: glib-compile-resources glib-compile-schemas
glib-genmarshal glib-gettextize glib-mkenums


If I enter the command

pkg-config --list-all

I can find, among others

glib-2.0              GLib - C Utility Library


Also tried to check, and they match:

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

-I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include
-I/opt/local/include  -L/opt/local/lib -lglib-2.0 -lintl

/opt/local/bin/pkg-config --cflags --libs glib-2.0

-I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include
-I/opt/local/include  -L/opt/local/lib -lglib-2.0 -lintl


In macports a member advised me to set the $PKG_CONFIG_PATH to "
/opt/local/lib/pkgconfig" but haven't been able to, even though I made a
little search for it...

How should one set it, in case this is the error?

Sorry for maybe a dumb error but I am kind of new to the system itself.

Thank you in advance!

Diogo Brito
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20121001/88ba50fb/attachment.html>


More information about the macports-users mailing list