Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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.
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.
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?
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
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..
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
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:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.