LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-07-2004, 02:23 PM   #1
Boudewijn
Member
 
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219

Rep: Reputation: 30
Compiling GLIBC, and linking it correctly


Hi,


I've got a MDK10 system, and I love to compile apps. So I compiled my kernel (atm 2.6.9), my apps and a few days ago I decided to compile GTK+ myself (wanted the new GAIM, and decided not to get an RPM) . Therefore I need the following things:

-ATK
-GLIB
-Pango

Note: I've got gtk+ version 2.4.13

ATK compiled without any problems, and Pango needed the new GLIB (I got 2.4.7 from gtk.org).

So I've build GLIB:

./configure
make
(as root) make install

Afterwards, I tried to compile Pango:

Code:
checking for GLIB - version >= 2.4.0... no
*** Could not run GLIB test program, checking why...
*** The test program failed to compile or link. See the file config.log fo
*** exact error that occured. This usually means GLIB is incorrectly insta
configure: error:
*** Glib 2.4.0 or better is required. The latest version of
*** Glib is always available from ftp://ftp.gtk.org/.
Well, it should be no surprise to hear that I've decided that Glib isn't recognized correctly (in other words: the old GLIB is use
d instead of the new one).

I tried:

/sbin/ldconfig , which didn't work either

I also set some environment variables, although I do not remember exactly which ones , so this is the output of 'env'
Code:
LESSKEY=/etc/.less
LC_PAPER=nl_NL
KDE_MULTIHEAD=false
LC_ADDRESS=nl_NL
LC_MONETARY=nl_NL
HOSTNAME=zeus
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,rsvd
GTK2_RC_FILES=/usr/share/themes/Galaxy/gtk-2.0/gtkrc:/etc/gtk-2.0/gtkrc:/home/boudewijn/.gtkrc-2.0:/home/boudewijn/.kde/share/config/gtkrc
TMPDIR=/home/boudewijn/tmp
GTK_RC_FILES=/usr/share/themes/Galaxy/gtk/gtkrc:/etc/gtk/gtkrc:/home/boudewijn/.gtkrc:/home/boudewijn/.kde/share/config/gtkrc
GS_LIB=/home/boudewijn/.fonts
WINDOWID=29360133
LC_NUMERIC=nl_NL
QTDIR=/usr/lib/qt3/
KDE_FULL_SESSION=true
USER=boudewijn
XCURSOR_SIZE=
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
LC_TELEPHONE=nl_NL
ENV=/root/.bashrc
SESSION_MANAGER=local/zeus:/tmp/.ICE-unix/2458
USERNAME=root
KONSOLE_DCOP=DCOPRef(konsole-2475,konsole)
MAIL=/var/spool/mail/boudewijn
DESKTOP_SESSION=default
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
LC_MESSAGES=en_GB
SECURE_LEVEL=3
LC_IDENTIFICATION=nl_NL
LC_COLLATE=en_GB
KONSOLE_DCOP_SESSION=DCOPRef(konsole-2475,session-14)
INPUTRC=/etc/inputrc
PWD=/home/boudewijn/pango-1.4.1
XMODIFIERS=@im=none
LANG=en_GB
HELP_BROWSER=kfmclient openProfile webbrowsing
LC_MEASUREMENT=nl_NL
HISTCONTROL=ignoredups
SHLVL=4
HOME=/home/boudewijn
LANGUAGE=en_GB:en
XCURSOR_THEME=default
GCONF_TMPDIR=/tmp
TMP=/home/boudewijn/tmp
LESS=-MM
LOGNAME=boudewijn
LC_CTYPE=en_GB
LESSOPEN=|/usr/bin/lesspipe.sh %s
BROWSER=kfmclient openProfile webbrowsing
DESKTOP=kde
DISPLAY=:0
LC_TIME=en_GB
G_BROKEN_FILENAMES=1
COLORTERM=
LC_NAME=nl_NL
XAUTHORITY=/root/.xauthtlo41G
OLDPWD=/home/boudewijn
_=/bin/env
I've messed around for about 4 days (20 hours) , and still I don't have a clue about what I'm doing wrong.

Has anybody encountered this problem yet?

Thanks in advance
 
Old 11-07-2004, 02:53 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
first don't confuse glib with glibc !!!!
ok on to glib

look in th directory /usr/lib/pkgconfig
in there is there a file glib-2.0.pc
if so run
pkg-config --modversion glib-2.0.pc
and see what you get

now go to /usr/local/lib/pkgconfig
see there if you don't also have a file glib-2.0.pc ??
if so do
pkg-config --modversion glib-2.0.pc
and see what you get

now if you have two of these files they are in conflict
if both directories are in the shell variable
PKG_CONFIG_PATH
(you don't seem to have a variable PKG_CONFIG_PATH ??? that's a problem)
export PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
will fix you
by default pkg-config will only look at /prefix/lib/pkgconfig where prefix is it's own install prefix

so you just have to manipulate these files and they point to what version to configure against
rename the old one or something and keep it around if you need it later.
 
Old 11-07-2004, 03:38 PM   #3
Boudewijn
Member
 
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219

Original Poster
Rep: Reputation: 30
in /usr/lib/pkgconfig:

[boudewijn@zeus pkgconfig]$ pkg-config --modversion glib-2.0.pc
2.2.3

in /usr/local/lib/pkgconfig:

[boudewijn@zeus pkgconfig]$ pkg-config --modversion glib-2.0.pc
2.4.7


Ok, there is indeed (as you suggested) a discrepancy between those files. And I've exported the environment variable. However:

Quote:
so you just have to manipulate these files and they point to what version to configure against
rename the old one or something and keep it around if you need it later.
I've copied the file which indicated 2.4.7 to the location of the 2.2.3 and replaced the lather one. After that I did (as root): export PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
When I run the pango configure:

Code:
checking for GLIB - version >= 2.4.0...
*** 'pkg-config --modversion glib-2.0' returned 2.4.7, but GLIB (2.2.3)
*** was found! If pkg-config was correct, then it is best
*** to remove the old version of GLib. You may also be able to fix the error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
*** to point to the correct configuration files
no
configure: error:
*** Glib 2.4.0 or better is required. The latest version of
*** Glib is always available from ftp://ftp.gtk.org/.

What's wrong now?



Note: env says:

PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

which seems right to me
 
Old 11-07-2004, 09:50 PM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
it is possible for a package to use pkgconfig differently
and use linker flags to make sure it links to the correct lib with the path included in the executable
but since that's not happening
this is kind of tricky but worth a try

you don't want to mess with the glib library in /usr/lib/libglib-2.0.so.0.200.3
lots of stuff on your system needs it
but in there with it is a link libglib-2.0.so and it can point to the newer version
but after you are done put it back to pointing to libglib-2.0.so.0.200.3 again
ln -s <target> <linkname> (make sure you don't type the target linkname in the reverse order)
after you change the link it will configure and compile
i think at this point configure this with a strange prefix like "./configure --prefix=/opt/newgaim"
then after you install it fix the /usr/lib link back and i think fix the old .pc file back as well


now you kind of don't want your system finding the newer glib library but you need the newer programm to find it. so i think the safest thing is to just move the new libglib (the one in /usr/local/lib) and it's links
to the new gaim folder /opt/newgaim/bin ?? put it in the same folder as the executable wherever that is
and it should load from there....
if it doesn't load just add a dot "." to LD_LIBRARY_PATH at the start like
export LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH

three cheers for operating outside of the box
 
Old 11-08-2004, 02:49 AM   #5
Boudewijn
Member
 
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219

Original Poster
Rep: Reputation: 30
first, I've copied libglib-2.0.so.0.400.7 to /usr/lib
Now I've got looking at the symlinks:
Code:
lrwxrwxrwx  1 root root      22 Nov  4 20:12 libglib-2.0.so -> libglib-2.0.so.0.200.3*
lrwxrwxrwx  1 root root      22 Nov  4 20:10 libglib-2.0.so.0 -> libglib-2.0.so.0.200.3*
I don't know which one to replace, so I'll replace them both (after backing them up).

Now I did:
Code:
[root@zeus lib]# ln -s libglib-2.0.so.0.400.7 libglib-2.0.so -f
[root@zeus lib]# ln -s libglib-2.0.so.0.400.7 libglib-2.0.so.0 -f

Compling pango works now

Thanks a lot !!!

Note1: do you know a nice reference about this stuff? (preferably on the internet)
Note2: is the new glib incompatible with the old one; do I have to move the symlinks back to their normal state?
 
Old 11-08-2004, 12:11 PM   #6
Boudewijn
Member
 
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219

Original Poster
Rep: Reputation: 30
I hope this post isn't too offtopic, but I was just trying to compile GAIM and I've encountered the same problem but instead of GLIB, GTK+ was missing.

So I've looked for gtk*.pc and gtk*.so using (s)locate, but I wasn't able to find them. I've also added the GTK path to my env variables.

/sbin/ldconfig was also run


I'm wondering what I still have to do....
 
  


Reply


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
Compiling glibc-2.3.5 or glibc 2.3.5-r1 on Gentoo fails ghrellin Linux - Software 2 07-19-2005 02:01 AM
building glibc 2.3.5 for static linking. rekhakp Linux - Software 0 04-26-2005 01:17 PM
compiling linking help blackzone Programming 1 02-13-2005 11:40 PM
Linking with different versions of glibc. dimm_coder Programming 2 11-25-2003 07:25 AM
compiling and linking boku Programming 5 12-25-2002 10:23 AM


All times are GMT -5. The time now is 02:44 AM.

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