LinuxQuestions.org
Visit Jeremy's Blog.
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 03-07-2004, 01:17 AM   #1
h4dyce
LQ Newbie
 
Registered: Mar 2004
Location: Fort Collins, CO
Posts: 3

Rep: Reputation: 0
what's a library?


Learning on Mandrake 9.2.
I'm installing XMMS. I don't know how to do that I downloaded a file called xmms-1.2.10.tar.gz. I understand that tar means it's a tarball. I don't know what gz is.

The main question I have right now is what is a library? What does it do, how do I get it, and what do I do with it?

I am pretty confident I can figure that stuff out if I keep reading, but I don't know where to look. It seems like there are no complete manuals for Linux.

I downloaded Mandrake becasue I have always used Windows, but I don't want to use stolen softeware anymore and I don't want to buy Windows or Office! OpenOffice is nice!

Thanks,
Henry
 
Old 03-07-2004, 02:20 AM   #2
kevinalm
Member
 
Registered: Oct 2003
Location: Iowa
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288

Rep: Reputation: 30
tar.gz means that it is a tape archive gnu zipped file. Basically, it is a directory/file tree compressed into a single file. It you issue the command:

tar -zxvf xmms-1.2.10.tar.gz

the original directory/file tree will be extracted in the current directory.

This will likely be a c or c++ program that must be compiled into an executable program. You will need the "development" packages installed on your system. The instructions to do the compile are usually in a text file named README or INSTALL in the "top level" directory of the extracted sources, in this case in a directory most likely named xmmx-1.2.10 .

As to the definition of a library, think of it as a suite of subroutines. This glosses over a lot, but it is the basic idea. Many programs require certain libraries and library versions to be installed on your system.

Last edited by kevinalm; 03-07-2004 at 02:25 AM.
 
Old 03-07-2004, 02:35 AM   #3
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
To try to expand on the lib part: A library is basically a collection of reusable code that is incorporated into the source code of a particular app when it's compiled (or maybe invoked during runtime). To do a simple shell script example (cuz that's all I can do ), if you had a function defined in ~/.bash_profile
Code:
calc () 
{ 
    echo "$[$1]"
}
and used 'calc' in a script, ~/.bash_profile would be acting sort of like a library when your command (script) was interpreted. If you deleted those lines from your profile, your script would no longer run properly because 'calc' wouldn't exist. As bash knits those together in interpreting, so a library contains code that gcc knits together in compiling. The xmms source code says 'include this code from this lib' and gcc says, 'okay, here's the file, here's the code - done'. If it can't find the code it can't include it and either errors out or, if it goes ahead, the code will be incomplete and the app will be broken. As far as how you get it, you just search for it and download it, or use your distro's package management tools like anything else and, as far as what you (as a user) do with it, you just install it - if it's in the places gcc looks when looking to include stuff, all is roses.

Somebody who actually knows what they're talking about could probably explain it better. And I'd be happy to hear it and understand it better, myself.
 
Old 03-07-2004, 03:25 AM   #4
kevinalm
Member
 
Registered: Oct 2003
Location: Iowa
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288

Rep: Reputation: 30
Ok, in c/c++ (and other languages) in is possible and common to convert source code (the original human readable program) into an intermediate stage called object code. This consists mostly of machine code with embedded info on how to merge (link) it with other object files when loading it into memory to create an executable. There are standardized libraries of object files that implement commonly used functions. Usually they are archived into a single file, like a tar file, only they use a different format. This is a library. As an example there is gtk, the gnome toolkit, that implements graphical elements, buttons and such in the gnome environment.

The reason for doing this is that it can save huge amounts of hd space. Suppose you had a monolithic executable of 10 mebabytes. Take the same program written to use libraries, maybe 5 mb. Take that times all the programs on a linux system, you get the idea.

As I said before, this is glossing over a _lot_. But without assuming a knowledge of c/c++, it's hard to explain the elagence of the use of libraries.
 
Old 03-07-2004, 03:28 PM   #5
h4dyce
LQ Newbie
 
Registered: Mar 2004
Location: Fort Collins, CO
Posts: 3

Original Poster
Rep: Reputation: 0
thanks

Just a quick thankyou. That was my first post here, and I really appreciate your time! I look forward to getting know this cool free software better and the crazy commmunity that supports it!
Henry
 
  


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
Which library ? wood@addanc Programming 3 02-20-2005 03:14 PM
adding a bulit in library to my library lg3 Linux - Software 1 10-17-2004 09:19 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 05:20 AM
what is the function library of the basic graphics library in rethat9.0? zerwolve Red Hat 0 04-29-2004 10:18 PM
library.. johnyy Linux - Software 2 06-23-2003 11:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:13 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