Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-21-2005, 06:18 PM   #1
LQ Newbie
Registered: Jun 2005
Location: Salem, Oregon
Distribution: Kubuntu
Posts: 3

Rep: Reputation: 0
compiling error with GTK+

After finally getting GTK+ 2.6.7 to compile and install I am having a problem using the library while compiling another program. Here is the relevant text from compiling the program:

checking for GTK+ - version >= 2.0.0... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.

The relevant text (as near as I can tell) from config.log is:

configure:2987: checking for GTK+ - version >= 2.0.0
configure:3102: gcc -o conftest -g -O2 -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include conftest.c -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 >&5
/usr/local/lib/ undefined reference to `pango_renderer_get_type'
/usr/local/lib/ undefined reference to `pango_renderer_set_matrix'
/usr/local/lib/ undefined reference to `g_assert_warning'
/usr/local/lib/ undefined reference to `pango_renderer_draw_glyphs'
/usr/local/lib/ undefined reference to `pango_renderer_draw_layout'
/usr/local/lib/ undefined reference to `pango_renderer_draw_layout_line'
/usr/local/lib/ undefined reference to `pango_font_description_get_size_is_absolute'
/usr/local/lib/ undefined reference to `g_return_if_fail_warning'
collect2: ld returned 1 exit status
configure:3105: $? = 1
configure: program exited with status 1

I've tried setting the PKG_CONFIG_PATH and LD_LIBRARY_PATH variables but I keep getting the same message. GTK seemed to compile and install fine once I got the supporting libaries installed with the above variables set to find the libraries. Could someone with more programming experience, please, point me to where my problem is? Thanks.

Oh, and a secondary question. Is there a file in which the PKG_CONFIG_PATH is defined? It seems that after I make the change with "export PKG_CONFIG_PATH" it only lasts as long as I have the terminal open. When I reopen the terminal and type "env" there is no PKG_CONFIG_PATH entry and I swear that I've had to reset it when trying to compile.

Last edited by dantelives; 06-21-2005 at 06:33 PM.
Old 06-21-2005, 08:03 PM   #2
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
first when you retry stuff either start off with a fresh package untar or make sure you delete any files
configure.cache or like that
some rocket scientist thinks it's a good idea for configure to remember failure

first i think pkgconfig searches it's own prefix first by defautl and i'm not really sure you can change that but i might be wrong
i would put those variable exports in ~/.bash_profile
and they will get read when you log in
for imediate read in
source ~/.bash_profile
might want to log all the way back out and back in so you know the are set for all new terminals you open

beyond that it gets real tricky when you want to keep two different versions of gtk2 and freinds
but i can at least talk about the situation in general and possibly you can figure it out

tricky mainly because the package config files are all just called for instance
gtk+-2.0.pc no matter which version of gtk it points to
plus the .pc files are setup to find not the actual library names but equally generic links called things like just or

but beyond that you have to think about the headers
do you have some headers in /usr/local/include now ??? if not your new headers in /usr/include killed (coppied over) the old ones ?? not sure just have to check it out

the *.pc files no doubt point to the correct headers and dependancies but only if the right .pc is being used (you might have to actually hide some old .pc files)

you can use the command "ldd" to see what libs are linked to what like
(gary) /usr/lib  $ ldd =>  (0xffffe000) => /usr/lib/ (0x40047000) => /usr/lib/ (0x40086000) => /usr/lib/ (0x400b5000) => /lib/ (0x40156000) => /usr/lib/ (0x40168000) => /usr/lib/ (0x401ac000) => /lib/ (0x401b1000) => /usr/lib/ (0x401b5000) => /lib/ (0x40241000) => /lib/ (0x40357000) => /usr/lib/ (0x4037a000)
        /lib/ => /lib/ (0x80000000)
and even look for object references with commands like
objdump -t /usr/lib/ | grep g_assert_warning
but remenber the libs contain references to other libs so you sometimes have to follow dependancies to actually find stuff.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GTK error when starting gtk-chtheme Dswissmiss Linux - Software 1 10-01-2004 11:53 PM
GAIM: compiling gtk 2.4.0 error turtle1980 Linux - Newbie 5 08-11-2004 08:15 AM
compiling gaim/ gtk error (two versions of gtk) webazoid Linux - Software 0 07-06-2004 06:05 PM
help with error compiling gtk+-2.4.0 Metal Martian Linux - Newbie 3 05-11-2004 09:04 AM
error with gtk compiling mplayer with gui Anubis Linux - General 2 02-29-2004 01:20 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration