On Wednesday 20 February 2013 00:09:31 Wang Sen wrote:
> I'm trying to build our project by autotools. When I was checking whether
> glib exists or not by the macro AC_CHECK_LIB, it always said no even if I
> have inst- alled glib-2.0 in my computer, which has Linux Mint 13
> installed.
> 
> The macro AC_CHECK_LIB in configure.ac:
> AC_CHECK_LIB([glib-2.0])
> 
> Here's information of glib-2.0 in my system:
> $ pkg-config --libs --cflags glib-2.0
> -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include 
> -lglib-2.0

don't use AC_CHECK_LIB if a package provides a pkg-config file.  use 
PKG_CHECK_MODULES instead:

        PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.12])

this will create $GLIB_CFLAGS and $GLIB_LIBS for you to use when 
compiling/linking.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to