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 03-14-2004, 06:09 AM   #1
tusher
Member
 
Registered: Aug 2003
Distribution: RedHat
Posts: 36

Rep: Reputation: 15
Question Linux OS and file format related question.


Hi,

I am looking for some documentation/resource that describe .. how linux OS works and how the application interacts with OS after compiling from source code.

Actually i mean to say, what happens when any application or package compiled from source code,

1. what is .pc file ? what about .so file and what does ldconfig command do?

2. why there are two pkgconfig directory ?

/usr/lib/pkgconfig
/usr/local/lib/pkgconfig

3. what does lpdconf command do?

4. what happen if i edit any new path at /etc/ld.so.conf file?

any idea ? plz help.

Thanks,
 
Old 03-14-2004, 08:51 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hello,

I can't answer to all your questions, but I have some answers
1) a .so file is a shared objetc file: A library which is dinamically loaded at program execution. To see the program .so dependencies, do:
ldd program_name

1) and 4) ldconfig is an application which read /etc/ld.so.conf file to know where .so can be located. By default, ldconfig knows that they are by default either in /lib or in /usr/lib, that's why when you install a program with .so located in strange directories (/home/foo/lib for example), you need to edit /etc/ld.so.conf to add this path and then run ldconfig to permanently add this path. There's another solution: it's to use LD_LIBRARY_PATH environnement variable. If you don't do that when you run your program, you will have an error message about a .so which can't be loaded or located

Oliv'
 
Old 03-14-2004, 09:27 AM   #3
Pres
Member
 
Registered: Jun 2002
Location: Australia
Distribution: Slack 9.1
Posts: 232

Rep: Reputation: 30
3) lpdconf is very probably a "line printer daemon configure" utility, but I can't be certain as I don't have it. Try the man pages for these things, "man ldpconf" for example.
 
Old 03-14-2004, 11:55 PM   #4
tusher
Member
 
Registered: Aug 2003
Distribution: RedHat
Posts: 36

Original Poster
Rep: Reputation: 15
Hi Oliv',

Thnx for ur reply. u told "There's another solution: it's to use LD_LIBRARY_PATH environnement variable."

but i got from error message and the message suggest to fix PKG_CONFIG_PATH environment variable. I did it with

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH: /what/the/directory/is
command. but once i turned the pc off, it seemd like, the configuration was gone. anyway to make it permanent?

2. do u know difference between this two variable? LD_LIBRARY_PATH and PKG_CONFIG_PATH?

3. what is pkg-config ?

(Thnx Pres, for the lpdconf, but i did a mistake typing ldconfig..so it appears lpdconf.

Thnx all of you once again.
 
Old 03-15-2004, 12:06 AM   #5
tusher
Member
 
Registered: Aug 2003
Distribution: RedHat
Posts: 36

Original Poster
Rep: Reputation: 15
Question file format related questions.

Hi,

can anyone tell me what is .pc and what about .so file format? is they something like .dll file of windows ? if so, whats the difference between .pc and .so?

how to know about all environmental variable used on linux OS ? Is there any documentation of it?

thnx in advance,
 
Old 03-15-2004, 12:10 AM   #6
ProtoformX
Member
 
Registered: Feb 2004
Location: Canada
Distribution: LFS SVN
Posts: 334

Rep: Reputation: 34
.pc tells pkg-config where and what the lib contans
and .so are libs
 
Old 03-15-2004, 12:17 AM   #7
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
.so are like .dll

also remember that some programs use mime type and not extensions to identify programs (windows uses extension only to tell that files are what, its really quite sad as i can rename a picture to something.exe and windows try to run it, sad, really really really sad

type
Code:
export
in the bash prompt, that should list all the environment variable it sees

Last edited by SciYro; 03-15-2004 at 12:19 AM.
 
Old 03-15-2004, 12:46 AM   #8
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
its really quite sad as i can rename a picture to something.exe and windows try to run it, sad, really really really sad

Kind of like how if I do chmod a+x on a jpeg, Linux will think it is a binary file and try to execute it...
 
Old 03-15-2004, 02:02 AM   #9
tusher
Member
 
Registered: Aug 2003
Distribution: RedHat
Posts: 36

Original Poster
Rep: Reputation: 15
Hi ProtoformX,

so, pkg-config something like registry of windows? or what?
 
Old 03-15-2004, 02:05 AM   #10
tusher
Member
 
Registered: Aug 2003
Distribution: RedHat
Posts: 36

Original Poster
Rep: Reputation: 15
Note, i m not comparing linux and windows, but trying to figure linux's working procedure...Is there any documentation on it? Like, how the Os work..and how later installed source application interact with the OS..where the registry maintains...etc..etc..

thnx.
 
Old 03-15-2004, 01:07 PM   #11
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hi Tusher,

Quote:
anyway to make it permanent
add the command either in /etc/profile script to make it permanent for everyone or in ~/.bash_profile for specific user
Quote:
what is pkg-config ?
Here is a very good def from man page
Quote:
The pkg-config program is used to retrieve information about installed libraries in the system. It is typically used to compile and link against one or more libraries.

So pkg-config is used for compilation whereas ldconfig is used for execution. That means PKG_CONFIG_PATH is used to know were I can find pkg-config exec and LD_LIBRARY_PATH is used in addition of /etc/ld.so.conf file and ldconfig utility to find where shared libraries are located.
Hope that I'm clear enough

Oliv'
 
Old 03-15-2004, 01:26 PM   #12
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
There are two pkgconfig directories because there needs to be one wherever .so files are stored (i.e. /usr/lib /usr/local/lib could both hold libraries and therefore each needs a pkgconfig directory). The .pc files in the pkgconfig directories hold information about the library so that a programmer can retrieve all the information they need to compile programs using the library more easily. For example, say I was writing a program using glib and needed to know where to find the include files, I could type:
Code:
pkg-config --cflags glib
or include that as part of a Makefile to find exactly what was needed. Try it yourself. Or try:
Code:
pkg-config --list-all
To see all installed libraries.
 
Old 03-15-2004, 01:49 PM   #13
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally posted by tusher
Hi ProtoformX,

so, pkg-config something like registry of windows? or what?
No, not in the least ... it's Gnome's way of telling
programs about relationships between files ...

There may well be systems out there that don't
have any .pc files :}

Quote:
where the registry maintains...
Thanks goodness there's no such abomination in
Linux ... all programs/daemons have their own individual
configuration files, which -as a rule of thumb- are
plain ASCII files.


Cheers,
Tink
 
Old 03-15-2004, 02:48 PM   #14
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 469Reputation: 469Reputation: 469Reputation: 469Reputation: 469
This thread is being merged with your other thread. If you need to expand on a question please post it in your original thread, do not start a new thread.
 
  


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
Question related to Linux filesystems, and XP kylere Linux - Newbie 5 08-01-2005 03:05 PM
Linux vs Mac question (Virus vulnerability related) unixfreak Linux - Security 14 08-29-2004 07:05 AM
Linux Newbie Question! (Web Server Related) ste_brough Linux - Distributions 1 02-03-2004 10:24 AM
Not really Linux related memory question Aerlock Linux - Hardware 2 10-18-2003 09:10 PM
mozilla/netscap history file related question.. beautifulmind Linux - Software 0 07-17-2002 09:48 AM


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