Re: Couldn't link my app with GTK+ 3



export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
./configure

pkg-config used in confugure script will use glib-2.0.pc from that location. PKG_CONFIG_PATH should point to your new glib's ${libdir}/pkgconfig/

Your old glib doesn't seem to have functions/symbols used in gtk-3 and you will need to use the new one.

Note that by installing with prefix=/usr, you overwrote old headers with new ones, but you installed libraries next to old ones. Looks like you should've used something like
./configure --prefix=/usr --libdir=/usr/lib64
as you seem to have multilib system. This will make old apps to use new glib, but that should be OK as only new api is added.

On 01/31/2011 12:02 PM, Mike wrote:
ä 2011å01æ31æ 16:56, David NeÄas åé:
On Mon, Jan 31, 2011 at 04:03:04PM +0800, Mike wrote:
OS: Fedora 14 x86_64
GCC: 4.5.1 20100924

I have a app project, use GTK+2.
I want to move it to GTK+3.
So I git clone latest glib.
Compiled them.
(I use GTK3 in mirror, not compile by myself)
Does pkg-config know about the new GLib? I.e. did you set
PKG_CONFIG_PATH? If it does not you cannot expect it to do anything
else than give you the flags for the system GLib.

Yeti


there are results..
------------------------------
$ pkg-config --cflags --libs glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -lglib-2.0
$ echo $PKG_CONFIG_PATH

$
------------------------------

Latest glib will be install to /usr/lib...


There is /usr/lib/pkgconfig/glib-2.0.pc (compile by myself)
------------------------------
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

glib_genmarshal=glib-genmarshal
gobject_query=gobject-query
glib_mkenums=glib-mkenums

Name: GLib
Description: C Utility Library
Version: 2.27.94
Libs: -L${libdir} -lglib-2.0
Libs.private:
Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include
------------------------------

And there is /usr/lib64/pkgconfig/glib-2.0.pc
------------------------------
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

glib_genmarshal=glib-genmarshal
gobject_query=gobject-query
glib_mkenums=glib-mkenums

Name: GLib
Description: C Utility Library
Version: 2.26.0
Libs: -L${libdir} -lglib-2.0
Libs.private:
Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include
------------------------------

Well... How to modify PKG_CONFIG_PATH?
I try to:
------------------------------
$ export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
$ ./configure
.....
$ make -j2
......
CCLD gkiu
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libgtk-x11-3.0.so:
undefined reference to `g_application_add_action'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libgtk-x11-3.0.so:
undefined reference to `g_application_set_action_enabled'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libgtk-x11-3.0.so:
undefined reference to `g_application_get_type'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libgtk-x11-3.0.so:
undefined reference to `g_application_quit_with_data'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libgtk-x11-3.0.so:
undefined reference to `g_application_run'
......
------------------------------




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]