LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   compiling error with GTK+ (https://www.linuxquestions.org/questions/linux-software-2/compiling-error-with-gtk-335905/)

dantelives 06-21-2005 06:18 PM

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/libpangoft2-1.0.so.0: undefined reference to `pango_renderer_get_type'
/usr/local/lib/libpangoft2-1.0.so.0: undefined reference to `pango_renderer_set_matrix'
/usr/local/lib/libpangoft2-1.0.so.0: undefined reference to `g_assert_warning'
/usr/local/lib/libpangoft2-1.0.so.0: undefined reference to `pango_renderer_draw_glyphs'
/usr/local/lib/libpangoft2-1.0.so.0: undefined reference to `pango_renderer_draw_layout'
/usr/local/lib/libpangoft2-1.0.so.0: undefined reference to `pango_renderer_draw_layout_line'
/usr/local/lib/libpangoft2-1.0.so.0: undefined reference to `pango_font_description_get_size_is_absolute'
/usr/local/lib/libpangoft2-1.0.so.0: 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.

foo_bar_foo 06-21-2005 08:03 PM

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 libpango-1.0.so.0 or libglib-2.0.so.0

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
Code:

(gary) /usr/lib  $ ldd libpangoft2-1.0.so
        linux-gate.so.1 =>  (0xffffe000)
        libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x40047000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x40086000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x400b5000)
        libz.so.1 => /lib/libz.so.1 (0x40156000)
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x40168000)
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x401ac000)
        libdl.so.2 => /lib/libdl.so.2 (0x401b1000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x401b5000)
        libc.so.6 => /lib/libc.so.6 (0x40241000)
        libm.so.6 => /lib/libm.so.6 (0x40357000)
        libexpat.so.0 => /usr/lib/libexpat.so.0 (0x4037a000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

and even look for object references with commands like
objdump -t /usr/lib/libglib-2.0.so.0 | grep g_assert_warning
but remenber the libs contain references to other libs so you sometimes have to follow dependancies to actually find stuff.


All times are GMT -5. The time now is 04:36 AM.