LinuxQuestions.org
Help answer threads with 0 replies.
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 04-01-2004, 02:27 AM   #1
Smaugur [SWE]
LQ Newbie
 
Registered: Mar 2004
Location: STOCKTOWN/SWEDEN
Distribution: Slackware
Posts: 5

Rep: Reputation: 0
Whats the deal with libraries?


What are the libraries good for ?


I want to know more about them.
 
Old 04-01-2004, 02:47 AM   #2
qwijibow
Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
libraries hold algorithms....
the thing about computer programs, is they all do the same thing, they put things on your screen, they load and save files, they make noises, they talk to other machines over the internet........

it would be a waste of time if every time a programmer made a program they had to write there own Disk accessing functions !!! and programs would be HUGE.

so, the disk accessing functions are written only once, and saved in a library that any other application can use.

unless you are programming in Assembly, then computer programming is all about writing algorithms, and calling library functions, getting them to do what you want.
 
Old 04-01-2004, 05:43 AM   #3
Smaugur [SWE]
LQ Newbie
 
Registered: Mar 2004
Location: STOCKTOWN/SWEDEN
Distribution: Slackware
Posts: 5

Original Poster
Rep: Reputation: 0
qwijibow Thank you! for refreshing my memory,
So libraries is good to know about if you are a programmer interesting.
 
Old 04-01-2004, 05:59 AM   #4
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Rep: Reputation: 32
good topic

Yes thanks qwijibow, good ques, Smaugur.

Next two:

1. are there many cases of libraries for libraries? (I came across a "libglib" once).

2. Are reverse compatibilities respected in library upgrades? It would seem so, due to the convention of renewing symlinks a generic library name to the latest library version. But it would also seem it's a free-for-all sometimes.
 
Old 04-01-2004, 06:18 AM   #5
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 53
libglib isn't a library for a library, it's just a type library used by gtk. The gtk creators called it glib so the library file that it is stored in is called libglib.
 
Old 04-01-2004, 08:57 AM   #6
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
so libraries are sometimes not binary compatible with other versions? who cares, its called compiling, solves this little problem
 
Old 04-01-2004, 09:58 AM   #7
devinWhalen
Member
 
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Red Hat, openBSD,Mandrake,freeBSD,SunOS
Posts: 168

Rep: Reputation: 30
When I saw the title for this thread the first thing I thought of was the Seinfield episode where Jerry Seinfield intentionally tries to screw up his stand up comedy routine and starts off with:
"What's the deal with Cancer?"....and gets booed off the stage....hehehehe

Just thought I would share....made my morning

If you don't know what Seinfield is....just carry on...ignore this thread.

Later

P.S.

Sorry for taking up space on a valid and interesting thread with banal information :}
 
Old 04-02-2004, 05:06 AM   #8
qwijibow
Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
its quite impossible to program without using libraries...
take the age old "hello world" program.... (in c++)

#include<iostream>

using namespace std;

int main() {
cout << "Hello world" << endl;
return 0;
}

there you are using a function of the cout (C-out) class in the input / output library to print text to the screen.
 
Old 04-02-2004, 05:19 AM   #9
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Rep: Reputation: 32
library finery

Quote:
Originally posted by SciYro
so libraries are sometimes not binary compatible with other versions? who cares, its called compiling, solves this little problem
Could we do a quick rewind and slow-mo over this one? SO there's binary compatibility and source code compatibility then?
Typically, how does the (RE)compilation of the source get over the incompatibilities that the (PRE)compiled display?
This is the newbie forum don't forget.
 
Old 04-02-2004, 09:39 AM   #10
qwijibow
Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
lets say i have some source code.. (called My-Program)
and my program uses a function (called My-Function)
from a library called (My-Library version 1.2)

When i compile my program, it gets linked to My-Library version 1.2
at this linking stage, it looks inside My-Library, and gets the address of the function.

Now.. lets say i give the compiled binary of My-Program to someone who has version 1.1 of My-Library on there machine.... the older library probably still has a function called My-function, but the binary library is different, the function may be at a different address or whatever, anyway, My-Porgram will not reconise My-Library.

However, if instead i gave the other person the source code to My-Prigram, when they compiled it, the linker would link the compiled program to THEIR version of My-Library, which is version 1.1. and will still work.

well... thats a simplified version of what really happens.

Last edited by qwijibow; 04-02-2004 at 09:40 AM.
 
  


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
whats the deal with FC3 JiggaJerry Fedora 14 11-22-2004 07:16 PM
ok... whats the deal with permissions??? trey85stang Linux - Enterprise 4 07-14-2004 06:22 PM
kernel 2.6 whats the deal demmylls Linux - General 2 09-11-2003 09:56 AM
whats the deal with SATA? k33ze Linux - Newbie 2 08-17-2003 06:32 AM
ext2 filesystem fragmentation, whats the deal? bobthebat Linux - General 3 08-20-2001 02:35 PM


All times are GMT -5. The time now is 08:00 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration