LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Question about libraries (https://www.linuxquestions.org/questions/linux-newbie-8/question-about-libraries-292789/)

Scrob 02-20-2005 10:20 PM

Question about libraries
 
I have a general question about Installing programs in Linux. I have tried to install mplayer for the last week with no success, I have downloaded the source file, and tried to use ./configure --enable-gui
It returns with the following error:
Error: The GUI requires GTK devel packages (which were not found).

Anyway, I went to download GTK source and started to compile, and I am getting the following error:

checking for glib-2.0 >= 2.6.0 atk >= 1.0.1 pango >= 1.7.0... Requested 'glib-2.0 >= 2.6.0' but version of GLib is 2.4.8

configure: error: Library requirements (glib-2.0 >= 2.6.0 atk >= 1.0.1 pango >= 1.7.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

The weird thing about this is that I just installed glib 2.6.0 from source using ./configure, and make, and finally make install. It gave me no errors. All of my downloaded programs go to /home/scrob/Downloads/ and I am running the configure option from withing that directory after I have extracted the package.

I am very confused on how linux installs programs, but I am starting to make some sense out of the whole process, and I have the following questions:
1. Do I have to log in as root to use ./configure? I'm not talking about su, which I already use from within my user login, I'm talking logging out as user, and logging in as root altogether.
2. Is there a certain directory where I need to run the ./configure from to make sure that the packages are going to their default locations, or does that happen automatically?
3. Is there some sort of command that will show what libraries the system currently has installed?
4. Is there a file that I need to edit to reflect new libraries once they are installed so that the system will find them by default when running ./configure? If so, where do I look to find installed libraries? (I'm really lost on this one, is there a good website that explains the way that linux works as far as directory permissions, default install paths etc...?)

Thanks in advance!

I am using Fedora Core 3 and have updated all available updates.

__J 02-20-2005 10:54 PM

Re: Question about libraries
 
Quote:

Originally posted by Scrob
I have a general question about Installing programs in Linux. I have tried to install mplayer for the last week with no success, I have downloaded the source file, and tried to use ./configure --enable-gui
It returns with the following error:
Error: The GUI requires GTK devel packages (which were not found).

Anyway, I went to download GTK source and started to compile, and I am getting the following error:

checking for glib-2.0 >= 2.6.0 atk >= 1.0.1 pango >= 1.7.0... Requested 'glib-2.0 >= 2.6.0' but version of GLib is 2.4.8

configure: error: Library requirements (glib-2.0 >= 2.6.0 atk >= 1.0.1 pango >= 1.7.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

The weird thing about this is that I just installed glib 2.6.0 from source using ./configure, and make, and finally make install. It gave me no errors. All of my downloaded programs go to /home/scrob/Downloads/ and I am running the configure option from withing that directory after I have extracted the package.

I am very confused on how linux installs programs, but I am starting to make some sense out of the whole process, and I have the following questions:
1. Do I have to log in as root to use ./configure? I'm not talking about su, which I already use from within my user login, I'm talking logging out as user, and logging in as root altogether.
2. Is there a certain directory where I need to run the ./configure from to make sure that the packages are going to their default locations, or does that happen automatically?
3. Is there some sort of command that will show what libraries the system currently has installed?
4. Is there a file that I need to edit to reflect new libraries once they are installed so that the system will find them by default when running ./configure? If so, where do I look to find installed libraries? (I'm really lost on this one, is there a good website that explains the way that linux works as far as directory permissions, default install paths etc...?)

Thanks in advance!

I am using Fedora Core 3 and have updated all available updates.

I'll answer your questions first before the rant ;)

1). you only need to be root to install the built packages, not to run configure or make them ( this is a security risk, although not a big one, but something to keep in mind as it is possible for someone to attack you through your compiler).

2). you can run configure from anywhere, that is not what determines where things go.

3). for you, you'll want to use "rpm -qa | grep <library name> " to query for a specific package on your system. ( more on this down below)

4). /etc/ls.so.conf is it. if you install a new lib in say /opt/misc ( you'd need to do something like ./configure --prefix=/opt/misc which tells configure to set up the Makefile to install things to /opt/misc. this way, executables would end up in /opt/misc/bin, libraries in /opt/misc/lib, etc... but after your done you need to add the line /opt/misc/lib in /etc/ld.so.conf and run (as root) "ldconfig" to update your shared library cache. With linux, as always, there are other ways to accomplish the same thing but this is the "correct" way and since your a little newer to the gnu/linux world I'd suggest you stick with this for now)

now for your other problems. what you did is install a new glib in /usr/local. whenever you do ./configure (with no arguments), the installation prefix defaults to /usr/local ( this will pretty much always be true of applications, but some other packages ( like services and things like that) could be different, so keep in mind we are gonna look at this from an application standpoint). Now, your system came with a glib-2.x already installed in /usr and you installed a new one in /usr/local. This is where your problem is, as you cannot have two conflicting libraries installed at once (errrr... you can but thats a little beyond what we need to be doing here, plus, you need to know how to manipulate the entire environment of the system in order to do this. in short: don't mix incompatible versions on the same system). So... go back to that glib-2.6.0 directory and (as root since this will modify your system outside your home directory) run "make uninstall" to remove glib-2.6.0.

I am using Fedora Core 3 and have updated all available updates. [/B][/QUOTE]
Your second problem is your trying to install the wrong packages. MPlayer needs:

glib-1.2.x
glib-1.2.x-devel
gtk+-1.2.x
gtk+-1.2.x-devel
libpng
libpng-devel

installed. notice the glib and gtk versions are 1.2 not 2.x. These two ( as in glib-2.x and glib-1.2.x) can be installed on the same system without any conflicts ( completely different versions, my above comment was about mixing libs like glib-2.4.8 and glib-2.6.0 - won't work).

so fire up whatever package manager you want ( or just get em off of the install cd's, they'll be on there) and get the packages above. the -devel packages contain the things you need to compile against the libraries ( this is a common practice with rpm based distro's ( and apt-get ), to split the packages into multiple pieces, and it, well, sucks).

remember, check your system first to see if it has a lib already on it before trying to install a new one, and if you install a new one, it's always better to upgrade the one you have in the same location.

Next, I'd *highly* suggest when compiling to make rpm's out of your builds and install them instead of running "make install". This make it easier to upgrade/remove later on and also records the package in the rpm database ( this is important if you want to continue using rpm's in the future). there are multiple ways to do this, such as rpmbuild and checkinstall.

Also, learn how to check your system for what is and is not installed. On fedora, I'd imagine there is some gui tool somewhere in your menu's that would make this easy, or go with the above "rpm -qa | grep <package>. remember, rpm distro's split things so something like "libstdc++" which normally comes with g++ could be split off into it's own package independant of g++.

And lastly ( sorry I know it's long ), with your pkg-config problems above, this is a path problem. when you install to /usr/local ( which is what happens when you run ./configure with no arguments), the glib-2.0.pc file that configure was looking for above was located in /usr/local/lib/pkgconfig, but pkg-config does not know how to find this directory by default. you can get around this by:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH

keep in mind that will last only for the session your in currently. to make it permanent, you'd have to add it to your .bashrc or /etc/profile or something similar.

shengchieh 02-20-2005 10:59 PM

> 1. Do I have to log in as root to use ./configure? I'm not talking
> about su, which I already use from within my user login, I'm
> talking logging out as user, and logging in as root altogether.

In most cases, a simple su to log in as root from a console
will do. However, if the installer wants to pop up a GUI window,
it'll crash. Next then, try

xhost +x (so a new GUI window will pop up)

and run the installer again. If this fails, then try to
log in as root as the last resort.

Sheng-Chieh

Scrob 02-21-2005 10:03 PM

Mplayer gui problems.
 
Thanks, that all worked and I was able to install mplayer. No I have another question.

When I go to run gmplayer it gives me the following error

MPlayer 1.0pre6-3.4.2 (C) 2000-2004 MPlayer Team
CPU: Advanced Micro Devices Athlon MP/XP/XP-M Barton (Family: 6, Stepping: 0)
Detected cache-line size is 64 bytes
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE


vo: X11 running at 1024x768 with depth 24 and 32 bpp (":0.0" => local display)
gmplayer: symbol lookup error: /usr/lib/libgdk-1.2.so.0: undefined symbol: XListInputDevices

Any ideas what this could be?


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